Basically, there are a few approaches:
1.
Binding to Java objects. You have some classes that match the structure of the XML file, the library reads XML and hands over matching objects to you, or you hand it your objects and it creates the XML file.
There are tools that take an XML schema and automagically generate the necessary classes; there are others that take annotated classes and generate the XML schema- there are libs that do both.
I like this approach. If you have an existing XML schema, you just autogenerate the Java classes and work with them. This is the simplest approach wrt. to code.
Libraries using this approach are JAXB (part of J2SE 6) and the ones mentioned by the previous poster.
2.
DOM and similar approaches. Same as the above, but does not use specific classes- there's an Element class, an Attribute class and they mimic the XML structure.
The advantage over arbitrary classes binding is that you do not need XML documents to follow a schema. Code using DOM can work over any XML file and be generic. On the other hand, your code is not as clean as the previous option.
If you want to write code that deals with arbitrary XML files, you probably want this. DOM is builtin into J2SE, although the API is somewhat awkward (it follows the DOM standard, which is not "Java-friendly")- there's JDOM which is more Java-friendly.
3.
Streaming APIs. You point the library towards an XML file, the lib reads it and sends "events" to your code. You get a "open element" event, a "close element", etc.
The advantage of this approach is that memory usage is not proportional to XML size, which is sometimes a problem (think people who exchange massive amounts of data via huge XML files). Of course, programming a streaming API is even more troublesome than the DOM. So you only want this option if your XML files are large compared to your available RAM.
SAX is the standard streaming API built into Java. There's also StAX which shares the same advantages, but has a slightly different way of working.