An alternative is to create a TXMLObject directly from a java.lang.String:
String patientrawxml = "<patient><name .... ";
...
TXMLObject patient = TXMLObject.newInstance(patientrawxml);
</pre><BR><BR>Then you can insert this. <BR><BR>If you want to manipulate the TXMLObject as a DOM object before inserting it you can use the getDocument() method of TXMLObject, e.g<BR><pre class="ip-ubbcode-code-pre">
TXMLObject patient = TXMLObject.newInstance(patientrawxml);
Document patientdom = (Document)patient.getDocument();
// do stuff using DOM ...
remembering to cast the Object returned from getDocument() to a Document object.
There is a small advantage to Bills’ suggestion in that you can utilise Xerces specific parser features if this is a requirement.
For more information on Xerces, DOM and JAXP please have a look at http://xml.apache.org/xerces2-j/API.html.
HTH,
Stuart Fyffe-Collins
Software AG (UK) Ltd.
#webMethods-Tamino-XML-Server-APIs#webMethods#API-Management