My biggest issue with XML is trying to figure out if something is an attribute or a sub element. On the contrary, there are time when it would be nice for json to have attributes.
I think the only really happy path with XML is starting with an extremely rigid spec for extremely consistent data where you have official dtd releases if something changes, etc. I think if you’re trying to figure something structural out when you’re processing the data, you’ve already lost.