In Java how can you convert a String that represents a fragment of XML for insertion into an XML document?
e.g.
String newNode = \"valu
...and if you're using purely XOM, something like this:
String xml = "" + xml + " ";
Document doc = new Builder( false ).build( xml, null );
Nodes children = doc.getRootElement().removeChildren();
for( int ix = 0; ix < children.size(); ix++ ) {
otherDocumentElement.appendChild( children.get( ix ) );
}
XOM uses fakeRoot internally to do pretty much the same, so it should be safe, if not exactly elegant.