This blog post nicely describes how to generate Java classes with JAXB to read XML files, given a schema:
Using JAXB to Generate Java Objects from XML Document
In case you don’t have a schema you can also infer one. This online tool can do it for you:
http://www.freeformatter.com/xsd-generator.html