Parsing to the DOM is a lot simpler than parsing with JAXB. Note the difference: Parsing described in the standard APIs gives you the W3C DOM, a graph of standardized generic objects that represent XML bits and pieces. Parsing with JAXB gives you a graph of non-standard objects that have classes and field names that match the tags in the XML. I would personally walk a long ways to avoid JAXB on most days, but sometimes it pays off.
Either way, you can modify the graph of objects and generate a new XML string. Now the ease of use goes the other way ... the DOM is a pain to work with, while the custom Java objects you get from JAXB might more feel like normal Java work.
There is an XML forum here at the ranch. Maybe scroll down there and ask for examples. Let us know how you make out!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi