It doest not do the way u given the code here.one JAXB classes are generated for each "ComplexType" in ur XML Schema.One class(for Parent element in ur XML schema) will be generated which contains the instance objects for other complex elements, and each individual classes will be there for other child complex types in ur schema. By accessing the main root element class, u can access the instances for other child elements, thats how the concepts of marshalling/unmarshalling works. If u want to explore more, try to generate the JAXB classes for ur schema using JWSDP(Java webservices package) package using Ant Build tool.
JAXB concepts are wonderfull technoilogy in reading XML, file.
If u need more, just buzz me...here
Joined: Sep 17, 2001
say we have a schema that resembles my class structure. I think we can represent inheritance in xml schemas.