You'd want to use an event-based parser that conforms to the SAX protocol. As I recall it is included at least with JDK 1.5.
DOM parsers are easier to use, but they load the whole document into memory which you don't really need to do. All you care about is when the appropriate tags are encountered.