Is there something like JSON.stringify for xml?

Viewed 7852

Is there something like JSON.stringify for xml. I want to convert an object in Javascript to a string formatted like an XML.

I want to basically convert a js object like this

{name: "Haynesville_Production", 
geometryType: "esriGeometryPoint", 
maxRecordCount: 1000}

to an xml string like this

<name>Haynesville_Production</name>
<geometryType>esriGeometryPoint</geometryType>
<maxRecordCount>1000</maxRecordCount>"
2 Answers
Related