About the JSON ⇄ XML converter
SOAP services, RSS feeds and older enterprise systems still speak XML. Converting between the two formats is lossy unless attributes are handled properly, so this maps XML attributes to @-prefixed keys and text content to #text, which means the round trip keeps its meaning. XML parsing uses the browser's own DOMParser rather than a hand-rolled parser.
How to use it
- Paste JSON or XML — the direction is detected from the first character.
- Set the root element name (used when your JSON has more than one top-level key) and the indentation.
- Copy or download the converted document.
Questions
How are XML attributes represented in JSON?
As keys prefixed with @ — so <item sku="K"> becomes {"@sku": "K"}. Element text alongside attributes becomes "#text". Converting back turns them into real attributes again.
What happens to repeated elements?
Repeated sibling elements with the same name become a JSON array, and an array in JSON becomes repeated elements on the way back.
Does my JSON need a single root?
XML does. If your JSON has one top-level key it is used as the root element; otherwise the document is wrapped in the root element you name.