XML "failed" on several fronts, from the perspective of developers:
1) The XML DOM model was too complex. It had originally been designed as a way to create a low level library from which higher level libraries could be written, but those higher level libraries never materialized.
2) Namespaces should have been designed more intuitively. Namespaces are not unfamiliar to developers, but in most cases it's possible to import namespaces so that they are shared under the same rubric in languages such as Java. That was never an option with XML, and it meant that most XML documents became a cacophany of prefixes.
3) The presumption of containment proved deadly. XML eventually developed a streaming model, but it was a decade too late. Browser vendors found that if they had to wait for XML to completely load before it was processable, this proved to great a strain on browsers of the time.
4) XPath 2.0 never made it into the browsers' XML implementations, and consequently neither did XSLT 2 or XQuery, all of which were orders of magnitude better than their first versions. This kept the technology firmly on the server side.
5) E4X was never allowed to take off. It could very well have changed the course of development, making XML far easier to use on the browser, but political pressures within the W3C, browser vendors and the ECMA community conspired to kill it.
6) XML was also a casualty of the war between the philosophy that HTML was a language that could be extended given a suitable extension mechanism and the philosophy that HTML was a "sacred language" that could only be set by WHATWG and allied groups. Once the latter became the de facto position, XML was pretty much excluded from the browser.
7) Simon's points earlier indicate another critical reality - the community of _javascript_ REACT developers is larger than the number of XML practitioners at this point by a considerable margin, and REACT uses an "XML-like" language that is syntactically a mess, probably because they don't know any better and have no intention of rectifying this fact. Most of us who still play in the XML world are on the upper side of fifty; the average REACT developer is 27, and likely has never even worked with XML.
JSON is not necessarily a superior language for most data interchange, but it is in essence a security blanket for anyone who works in the web world (or within mobile app development, which is moving heavily towards _javascript_). XML is a Lincoln Town Car - big and luxurious and powerful, but something that no one under the age of 35 would drive if they can help it.
Kurt Cagle
Founder, Semantical LLC