See also:
Article

Parsing XML in JavaScript

How to parse XML in JavaScript?
XML

This is an example of parsing a string containing XML content:

const bookXml = `
    <book>
        <author>J. K. Rowling</author>
        <title>Harry Potter and the Philosopher's Stone</title>
    </book>
`;

const parser = new DOMParser()
const doc = parser.parseFromString(bookXml, 'application/xml')
Last updated on 6/16/2019 by Anton Vasetenkov.