I need to convert XML data to Java objects. What would be best practice to convert this XML data to object?
Idea is to fetch data via a web service (it doesn\'t use WSDL
JAXB is a standard API for doing this: http://java.sun.com/developer/technicalArticles/WebServices/jaxb/
For this you can also consider apache's bitwixt and simple framework for xml
I've used XStream as well, it is easy to use and customizable. You can add your own custom converters and that was very handy for me...
JAXB API which comes in Java(In built).
So surprised more people have not mentioned Jibx. Amazing lib and i think a lot simpler to use than Jaxb. Performance is also fab!
Another option is a Sax Parser. It is procedural - i.e. a visitor pattern - but if the xml is fairly lightweight, (and even medium weight) I have found it to be very useful for this.