title: how to convert xml document object to string?
body: <p>I have xml that I have in a string. I want to change some attributes in it.<br>
  So what I have done is   </p>
  
  <pre><code>var xml //contains xml  
  parser = new DOMParser()
  xmlDoc = parser.parseFromString(xml, "text/xml")
  xmlDoc.setAttribute("name", "random")
  </code></pre>
  
  <p>Now the xmlDoc has the required changes. But how do I get the string representation of the xml again?</p>