XML to ordered JSON tree
Inspect XML as an explicit JSON document tree that preserves element and mixed-content order.
Worked input and output
Input
<note priority="high">Hello</note>
Output
{
"type": "document",
"children": [
{
"type": "element",
"name": "note",
"attributes": [
{
"name": "priority",
"value": "high"
}
],
"children": [
{
"type": "text",
"value": "Hello"
}
]
}
]
}The attribute is an ordered attribute entry and Hello is a text child. SOAP, WSDL and RSS are treated as generic XML trees, not executed services or normalized feed models.