XStream is a simple library to serialize objects to XML and back again.

Features

Typical Uses

Known Limitations

If using the enhanced mode, XStream can re-instantiate classes that do not have a default constructor. However, if using a different JVM like an old JRockit version, a JDK 1.3 or you have restrictions because of a SecurityManager, a default constructor is required.

The enhanced mode is also necessary to restore final fields for any JDK < 1.5. This implies deserialization of instances of an inner class.

Auto-detection of annotations may cause race conditions. Preprocessing annotations is safe though.

Getting Started

Latest News

Dec 6, 2008 XStream 1.3.1 released

A new XStream maintenance version has been released. The release contains some bug fixes, some minor enhancements and support of new JDKs:

View the complete change log and download.

Note, that XStream really supports by default now only types of the JDK in use. Especially for CGLIB this means that support of those proxies will have to be explicitly activated first. However, support for CGLIB proxies is enhanced.

Note, to support a representation of null values in some way, it is absolutely necessary that each converter can handle a null value in its marshalling methods. If you have implemented your own custom converters, try to handle such a case also to prevent incompatibilities in case XStream will provide such values with its next major version.