Aside the recommended SAX parsing, you could use the StAX API (kind of a SAX evolution), included in the JDK (package javax.xml.stream ).
- StAX Project Home: http://stax.codehaus.org/Home
- Brief introduction: http://www.xml.com/pub/a/2003/09/17/stax.html
- Javadoc: https://docs.oracle.com/javase/8/docs/api/javax/xml/stream/package-summary.html