title: Create SVG object from string
body: <p>How can I create new SVG object from a string in JavaScript?</p>
  
  <p>Object to string</p>
  
  <pre><code>var str = new XMLSerializer().serializeToString(SvgDoc.getElementById(nameID));
  </code></pre>
  
  <p>String to object</p>
  
  <pre><code>var oParser = new DOMParser();
  var oDOM = oParser.parseFromString(str, "image/svg+xml");
  </code></pre>
  
  <p>But oDOM isn't an SVGGElement object.   </p>