This function serializes a DOMDocument into an XML string.
var xmlstring = App.serializeXml(DOMDocument);