JSON has objects, arrays, strings, numbers, booleans and null. XML has elements, attributes,
text, comments and processing instructions, and it has no types at all. Nothing in plain JSON
says whether "id": 7 should be <id>7</id> or
id="7", and JSON has no notion of an array as a container: XML expresses a list
by repeating an element. So any converter needs rules, and the target system usually decides
which rules are right.
The rules here are the inverse of the XML to JSON converter, so data
can make the round trip. The usual weak spot is a list with one entry: XML that contains a
single <item> looks exactly like XML for a non-list field, and whoever reads
it back has to know from a schema that it is a list.