Objects Become Elements
Each key in a JSON object typically becomes an XML element with that key as its tag name, and the corresponding value becomes that element's content — either text, for primitive values, or nested child elements, if the value is itself an object.
// JSON
{ "user": { "name": "Alex", "age": 30 } }
<!-- XML -->
<user>
<name>Alex</name>
<age>30</age>
</user>
Arrays Become Repeated Tags
Since XML has no native concept of an array, a JSON array is typically represented as multiple sibling elements sharing the same tag name — one per array item. A converter has to decide what to call these repeated elements, since JSON arrays don't carry a name for their individual items the way object keys do.
// JSON
{ "tags": ["admin", "editor"] }
<!-- XML -->
<tags>
<item>admin</item>
<item>editor</item>
</tags>
Where Attributes Come From
Plain JSON has no direct equivalent of an XML attribute — everything is just a key-value pair. Converters commonly use a naming convention, such as a leading @ on a key, to signal that a particular value should become an XML attribute rather than a child element. If your source JSON doesn't already follow such a convention, expect the converter to default to representing every key as a nested element rather than guessing which ones "should" be attributes.
Why This Matters When You're Not Just Eyeballing the Output
If the XML you're generating needs to match a specific schema or an existing system's expectations, these mapping decisions aren't just cosmetic — a system expecting an attribute won't recognize the same data represented as a child element, even though both are valid XML. Understanding how your converter makes these choices helps you catch mismatches before they cause an integration to fail downstream.
See these mapping rules applied to your own JSON data.
Open JSON to XML Converter