What JSON is
JSON is a text format for nested data: objects with named keys, arrays, strings, numbers, booleans and null. It has no date type and no comments.
Every web API, most configuration files and anything that talks to JavaScript.
What XML is
XML marks up data with nested named tags and optional attributes. It is verbose, strict about being well-formed, and can carry a schema that says what shape a document must have.
Enterprise integrations, government data feeds, RSS, SOAP services and older document formats.
What changes when you convert JSON to XML
Four shapes all read correctly: an array of objects, an array of arrays with a header row, an object of column arrays, and an object keyed by row id. A single wrapper key holding the array, which is how most APIs reply, is unwrapped automatically. Nested objects are flattened one level into dotted keys; anything deeper is kept as JSON text in the cell, because a table cannot hold a tree.
Each row becomes an element with one child per column. Header names are rewritten where they have to be, because an XML tag cannot start with a digit or contain a space, so a column called 2024 Sales becomes _2024_Sales.
Keys become element names, and some keys cannot be. An XML name cannot start with a digit or contain a space, so a key called 2024 Sales becomes _2024_Sales. The rewrite is mechanical and reversible by eye.
Characters that would break the markup are escaped. An ampersand becomes & and an angle bracket becomes <, which is what makes the output parse rather than fail on the first value containing a company name like Smith & Sons.
Everything becomes an element. JSON has no notion of an attribute, so there is nothing to map onto one, and inventing a rule about which keys become attributes would make the output unpredictable.
What carries over from JSON to XML
JSON records 2 things about a table that XML has no way to hold.
JSON distinguishes a number from the text of a number; XML does not, so every value arrives as text and has to be re-parsed by whatever reads it next.
An empty cell and a missing one are the same thing in XML, so a null and an empty string in the JSON both come out blank and can no longer be told apart.
The identifier 007 comes out of the XML as 007. Reading it as a number would have made it 7, and an id that changes value is worse than one that stays text.
The role "Analyst, data" survives with its comma, in one cell rather than split across two. That is the first thing to check in any converted table, and the usual place a XML file goes wrong.
The quotes around Jonah "Jo" Pryce are written as the HTML entity " in the XML.