There are three main methods for parsing XML in Java.
DOM - Read the whole file into memory and walk around in it.
PUSH - e.g. SAX - parse the file and use callbacks to tell you what is happening as the file flies paqst the parser.
PULL - e.g. StAX - Parse the file on-the-fly but pull each element out of the file one-by-one.
See Parsing XML using DOM, SAX and StAX Parser in Java for a more general discussion.
See What is 'Push Approach' and 'Pull Approach' to parsing? for a good discussion about the Push/Pull debate.
For large files, DOM will not work very well. For speed, either of the other two will work fine.