Here is the code currently used.
public String getStringFromDoc(org.w3c.dom.Document doc) { try { DOMSource domSource = new DOM
Relies on DOM Level3 Load/Save:
public String getStringFromDoc(org.w3c.dom.Document doc) { DOMImplementationLS domImplementation = (DOMImplementationLS) doc.getImplementation(); LSSerializer lsSerializer = domImplementation.createLSSerializer(); return lsSerializer.writeToString(doc); }