Java – Declarative XML -> POJO conversion

javaxml

I have to write a process (in Java) which periodically hits a URL, reads the returned XML document, and persists that data into the DB. This data is further used by my application, so I have modeled them as Hibernate-mapped POJOs.

I can parse the XML and then create appropriate POJOs, but I was looking for a simpler declarative approach. What libraries are available which can take a input configuration and create the POJOs from the XML document?

Best Solution

Another alternative could be JiBX

Also, although you said you don't want to parse the XML, XPath can be a very concise way of extracting the content you are interested in?