To also address this part which I seem to have missed earlier
> This all shows XML needing to support at least two different but related mechanisms. I'm not saying any of this is bad or that it makes parsing impossible: its just a source of complexity. JSON has key value syntax as well. XML has this flexibility but it quickly adds up. This is not a fault - it's the whole point of XML.
It is not really two different mechanisms. It simply is part of XML's syntax, just in the same way as these two JSON examples are very similar
[
{ "hello": "world"},
{ "hello": "world"},
{ "hello": "world"},
{ "hello": "world"}
]
{
"1": { "hello": "world"},
"2": { "hello": "world"},
"3": { "hello": "world"},
"4": { "hello": "world"}
}
Does any of that add complexity? Yes of course it does. If you dont want complexity you should probably go with a "Hello world" program, which incidentally will be also relatively bug-free ;)However saying the additional syntax support of XML adds complexity which adds hours of CPU time when processing the same data in different formats (JSON and XML) borders ludicrous. Unless your XML parser is (deliberately) slow of course.