I have done something similar using JAXB2 and Hibernate 3.2. Basically, you annotate your classes with both EJB3 and JAXB annotations. With your entities annotated a both JAXB & EJB3, you can then use JAXB to generate an XSD from your domain model that you can have other systems validate against. Form there it's very easy to go from XML -> DB and DB -> XML. Additionally, I have used Mule ESB to convert different message types to my domain model schemas. I have used this approach in my RESTful web services project:
http://resteasy.damnhandy.com/
It works remarkably well. One thing to keep in mind with One-to-Many relationships and JAXB is that you need to manage cyclic child-parent references. JAXB has the hooks to do this, and it's covered here:
https://jaxb.dev.java.net/guide/Mapping ... o_XML.html
Hope this helps.
Ryan-