iShowPDF

JSON to XML

JSON to XML converts JSON data into an XML document for older systems, SOAP services, feeds or any tool that only reads XML.

What JSON to XML does

JSON to XML converts JSON data into an XML document for older systems, SOAP services, feeds or any tool that only reads XML.

Keys become element names, and a list repeats its element once for each item. Keys starting with @ become attributes, and a #text key becomes the element's text, matching what our XML to JSON tool produces, so data can travel both ways. XML allows only one root element: if your JSON has several top keys or is a list, it is wrapped in a root whose name you choose. Characters not allowed in tag names become underscores.

How to use JSON to XML

  1. Paste the JSON

    Add an object or a list.

  2. Name the root

    Type the root element name used when the JSON has several top keys.

  3. Get the XML

    Copy it or download data.xml, which starts with an XML declaration.

Questions about JSON to XML

How do I make XML attributes from JSON?

Start the key with @. A key named @id inside an item becomes an id attribute on that element.

What happens to a top-level JSON list?

Each entry becomes an item element inside the root element.

Are special characters escaped?

Yes. Ampersands, angle brackets and quotes in values are escaped, and control characters that XML does not allow are removed.

Related tools