XML is a markup language defining hierarchical elements with attributes. Modern web apps and REST APIs prefer working with JSON structures because they map natively to JS objects. Our parser maps XML elements to JSON keys, tags with attributes to sub-properties, and duplicate sibling elements to array sequences. If you need to serialize JSON strings back to XML tags, use our
JSON to XML Converter. Here is a standard translation sample:
<!-- XML Input -->
<catalog id="1">
<book category="fiction">
<title>Great Gatsby</title>
</book>
</catalog>
// Converted JSON Output
{
"catalog": {
"@id": "1",
"book": {
"@category": "fiction",
"title": "Great Gatsby"
}
}
}