The DOMParser interface provides the ability to parse XML or HTML source code from a string into a DOM Document.
DOMParser
The XMLSerializer interface provides the XMLSerializer.serializeToString method to construct an XML string representing a DOM tree.
XMLSerializer