Possible Duplicate:
What is the best/simplest way to read in an XML file in Java application?
I have an xml like this:
<Root>
<Commodity>
<Which name="Book" />
<Book name="harley" price="5" />
<Book name="Marley" price="8" />
<Book name="hampi" price="10" />
</Commodity>
<Item>
<Commodity>
<Which name="fiction" />
<Book name="harley" price="5" />
<Book name="Marley" price="8" />
<Book name="hampi" price="10" />
</Commodity>
<Item>
<Commodity>
<Which name="thriller" />
<Book name="hjhj" price="5" />
<Book name="ccvcv" price="8" />
<Book name="vcvnnn" price="10"/>
</Commodity>
</Item>
</Item>
</Root>
I feel that this is a pretty complex xml structure since it has a nested tag. is there a way around to generate java class for the structure?