The information stored in this XML is essentially that:
{ "string": "The JSON format was invented by Douglas Crockford",
"structure" [
[ 0, 48, "div", {} ],
[ 4, 13, "a", { "href": "https://www.json.org" } ],
[ 32, 48, "em", {} ]
]
}
(If we allow empty elements, we'd need another field in the structural entries to be able to reconstruct the hierarchy.) Now I'd say that XML way to combine these three kinds of data is pretty elegant and natural. The JSON would be impossible to write by hand, although it's good for machine processing.
Upd: The three kinds of data: the string, the structures (div, a, em), and their position in the string.