In Java, there's the JAXB ”parser“ which translates an XML schema into (mostly) straightforward classes. Correct initial setup is the only hard part.
In XML you have to decide if you want DTD or schema enabled (which could provide default values, and could be a security risk) and where abs how you resolve the DTDs from etc. Do you resolve references? And many option options.
So JSON benefits not just from a simpler structure, but also from less optionality.
Basically, in a static typed language you decide for schema checking or not - like for Json -, serializing in structures or access in an API - like for Json.
It is just that JavaScript maps json directly in their dynamic object, array and native types. For xml that is an mismatch. For static languages both are an mismatch.
My understanding is that that's not the case. XML parsers are Pull or SAX based and it's weird as fuck.
You can abstract that out, but parser complexity isn't something to sneeze out. For one thing, parsing XML is notoriously dangerous - tons of vulns both at a design and memory management level.
As a consequence, JSON in JavaScript is super easy. Using XML is medium-hard.
In .NET using XML or JSON is easy (not super easy).
In C++ using XML or JSON is medium-hard.
Do not know the state of the art for Go, Rust, Java, ...
As a consequence, JSON is - from a JavaScript developer perspective - the holy grail. From a .NET/Java/C++ developer perspective it is just another format.