An even better solution is to use the JAXB implementation of JSPIFF and then you can use HyperJaxb2https://hyperjaxb2.dev.java.net/
Hyperjaxb provides a solution for the prevalent task of XML persistence which essentially lies in the following three operations:
* importing or saving the document;
* exporting or loading the document;
* querying for documents or their parts.
To solve this task, Hyperjaxb combines two technogies: Java Architecture for XML Binding and Hibernate. JAXB converts between XML and objects; Hibernate is used to persist object in a relational database.