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.