Another option is to use JAXB to generate Java objects and use Hibernate to create a schema based on a class hierarchy.
That being said, it depends on what you are trying to do, and I think that such decisions are likely to be fragile and difficult to maintain.
source
share