When you’re designing an XML schema, answering the question “should this be an attribute or a nested elember” is awkward because there is rarely an obvious correct answer.
With JSON, the answer is always a name/value pair.
A schema language in which subordinate values being presented as attributes vs. elements was a presentational option in the concrete XML representation rather than a dictate of the schema language would solve this simply. There are already multiple schema languages for XML; needing a better schema language doesn't begin to provide a reason for a different representation language, since schema and representation language are separate concerns.
JSON has data types built into it, XML needs its data type understanding defined by an external technology - often in the form of an irritating schema language that is hard for many people to understand, extraordinarily verbose, and which also has the downside of not being able to describe many of the constraints often encountered in actual XML formats.
It's a lot easier to read when a data format is written in JSON, when a document format is written in JSON the reverse is the general order (minus incidents where the format is obnoxiously constructed so as to defy understanding by outside parties)
I believe that was OP's point. Using the annotation you cannot add an attribute with subattributes. What if you wanted to add the employee's last six salaries. Suddenly you need to restructure your xml:
Using JSON, you just so: “salaries”: [10000,10000,10000]
JSON is not only less verbose, it is also more flexible and easier to read and understand. You don’t have to worry about should I use tags or attributes for that because I late might have to use sub tags, and that makes it far easier to use (and honestly parse as well because many XML documents I have gotten are very inconsistent).
Why do you need to restructure the xml? You can just keep the attributes. To add the salaries there are quite a few options, as XML is just as flexible as well.
Still more typing and less readable than the JSON. I happily used XML for years and have nothing against it. But JSON is almost always more readable. Big deal. Technology evolves. Trends that aren't an evolution usually fade. JSON does not seem to be one of those. It offers enough advantages over XML to have quickly replaced it in many cases.
Wether it is easier to read or not is entirely subjective. There is no quantifiable measure to state either way. Both have their use-case; one now more than the other.
With JSON, the answer is always a name/value pair.