title: Is parsing HTML with DOMParser safe from XSS?
body: <p>I am using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/DOMParser" rel="nofollow noreferrer">DOMParser</a> in my code as such:</p>
  <pre><code> html`${this.domParser.parseFromString(this.richText, 'text/html').body.children}`
  </code></pre>
  <p>After reading the documentation i became a bit worried that <code>Cross site Scripting attacks</code> were still possible because as the documentation states:</p>
  <blockquote>
  <p>You can perform the opposite operation—converting a DOM tree into XML or HTML source—using the XMLSerializer interface.</p>
  </blockquote>
  <p>However it also states that it returns</p>
  <blockquote>
  <p>Either Document or XMLDocument depending on the mimeType argument.</p>
  </blockquote>
  <p>So is using this method going good for securing your site against <code>XSS</code>?</p>