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')