Is there a way to convert a XML schema to a tree of Java objects with considering of type, ref etc.? I mean, take this
<xs:element name="root">
  <xs:complexType>
    <xs:sequence maxOccurs="unbounded">
      <xs:element name="elem" type="type1">
    </xs:all>
  </xs:complexType>
</xs:element>
<xs:complexType name="type1">
  <xs:sequence>
    <xs:element name="A" type="xs:string"/>
    <xs:element name="B" type="xs:string"/>
    <xs:element name="C" type="xs:string"/>
    <xs:any minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
and make a tree: root element "root" with child "elem" (with marked min and maxOccurs). "elem" also has children "A", "B", "C" and "any".
Is there such a way? Some library maybe?
And if not, what should I consider, aside from type and ref, to write such linearization thing myself?
 
    