I'm making an SVG application with JavaScript. Users can draw circles, polygons, etc. as they wish. I need a feature that users could save the file they have made. In PHP there is a function saveXML() that returns created XML file as text. Is there anything similar for SVG and JavaScript?