<body myattr="yeah">
<thing>hi</thing>
<thing thingattr="cool">hi2</thing>
<otherkindathing>hi2</otherkindathing>
</body>
can be thought of as nested objects, each having a typename, text content, and children. It doesn't translate nicely to JSON. Maybe: {"type": "body", "attrs": {"myattr": "yeah"},
"children": [{"type": "thing", "content": "hi"}, ...]}/j
PS won on human readability and editability but lost on portability to Adobe's own internal competitor, PDF, and because it fought and lost to (La)TeX -> PDF & (La)TeX -> DVI -> PS.
PS: I once printed out and bound the PDF 1.3 spec[0] on 24 lbs. bleached dead trees on an HP LaserJet IIIP with over a million page count. Some of the nuclear engineers and scientists an office containing <50 people routinely printed thousand page documents every week.
0. https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandard...
In all seriousness, everything in JSON can be expressed as XML; but not necessarily the other way around.
XML makes sense for open-ended, human-written things like documents or apps. It doesn't work so well for APIs and other machine-read/written things where you'd normally use JSON.
Like that time there were hundreds of forms to build, refused, held a silent protest until a reasonable way presented itself.
Enter "XML Form Template" or "XML Form Definition.", A form is generated from the XML in html, filled in, and on submit, the XML is filled back in.
Built one form renderer and done. Never got old watching it.
XForms (W3C standard)