SVG a String JavaScript

 var stringData = document.getElementById('my-svg').outerHTML;
Fancy Flatworm