The problem at hand typically involves doing something with the parsed information. Come walk with me a bit farther along the border between Java and XML, and I'll show you how to use Java to solve that problem, too. Let's proceed straight to the heart of the matter. The feature of XML we need to address is its ability to define new tags. This introduces a bit of uncertainty into the process.
Applications can ignore novel tags.
This was the approach typically taken by browser vendors during the height of the browser wars. Leading browser vendors merrily defined new tags with each release of their product, and each browser distribution quietly ignored those tags it didn't understand. This approach is safe but not very satisfactory. Organizations can standardize on a set of tags. This approach cleverly sidesteps the entire problem.