JSON to XML Conversion
JSON objects are converted to XML elements with keys as tag names.
Arrays are wrapped in repeating <item> elements.
Text values become text content within XML elements.
XML attributes are preserved with @ prefix when converting back to JSON.
The output is formatted with your chosen indentation for readability.
Elements vs attributes — the mapping question
XML has no arrays and JSON has no attributes, so conversion is a convention: JSON objects become elements with keys as tag names, arrays repeat an element, and XML attributes are marked with an @ prefix on the way back to JSON. Text mixed with child elements (mixed content) has no natural JSON representation — a converter must pick a field for the text.