title: Converting XMLDocument object to String in Javascript
body: <p>I want to convert XMLDocument object that I'm getting as a response from an ajax request, to a string. I tried using </p>
  
  <pre><code>new XMLSerializer()).serializeToString(xmlObject)
  </code></pre>
  
  <p>and I get the following response:-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;&lt;ns2:errorList xmlns:ns2="http://www.example.com/api/delivery/V1"&gt;&lt;error code="DOMAIN_VALIDATE" path="delivery.shipper"&gt;&lt;message&gt;empty&lt;/message&gt;&lt;/error&gt;&lt;error code="DOMAIN_VALIDATE" path="delivery.shipperSite"&gt;&lt;message&gt;empty&lt;/message&gt;&lt;/error&gt;&lt;error code="DOMAIN_VALIDATE" path="delivery.leg"&gt;&lt;message&gt;invalid&lt;/message&gt;&lt;/error&gt;&lt;/ns2:errorList&gt;
  </code></pre>
  
  <p>Means the method converted the whole XMLDocument into string, including the very first tag</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  </code></pre>
  
  <p>I don't want this part of the response. Is there any method that does that.
  Note: I don't want to use the workarounds like "substr" etc.</p>