Is there a library which could generate a xsd schema from a java class? Google yields lots of results the opposite ( java classes from xsd ).
JiBX does this
The schema generator tool first reads one or more JiBX binding definitions and then uses reflection to interpret the structure of the Java classes referenced in the bindings. By combining the binding definitions with the actual class information the schema generator is able to construct one or more XML schemas to represent the documents handled by the bindings.