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 ).
JAXB 2.0 allows you to create a XML schema from an annotated Java class.
You'll find some examples at the AMIS blog and at the JavaPassion site.