You can parse a string of text as XML or HTML using the Range.createContextualFragment() method. This is very helpful if you’re trying to parse a document fragment from a local endpoint (as I do here with transclusions).

JavaScript, programming, web development

References