Something like this....

import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.Serializer;
import org.apache.xml.serialize.XMLSerializer;
import java.io.StringWriter;

public String getDocumentAsString() throws ModelException {
     OutputFormat format = new OutputFormat(document); //Serialize DOM
     StringWriter stringOut = new StringWriter(); //Writer will be a String
     XMLSerializer serial = new XMLSerializer(stringOut, format);
     try {
          serial.asDOMSerializer(); // As a DOM Serializer
          serial.serialize(request);
     } catch (java.io.IOException ioex) {
          //handle exception
     }
     return stringOut.toString();;
}

j.

John O'Shea,
Phone : + 353 1 8154228       Email : [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to