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:
Did you like this post? Consider supporting me with a virtual coffee or beer.