How does XStream compare to JAXB (Java API for XML Binding)?
JAXB
- JAXB is a standard (JSR-222) with multiple implementations: Metro (the reference implementation), EclipseLink MOXy, JaxMe, etc.
- Can start with Java objects, these objects can be annotated to control the XML representation.
- Can start with XML schema and generate annotated Java objects.
XStream
- Can start with Java objects, these objects can be annotated to control the XML representation.
- Can not start from an XML schema, the XStream FAQ suggests XMLBeans for this purpose.
The following example compares JAXB and XStream: