question: public String toXML ( final XStream xstream , final Object obj ) throws ObjectStreamException { final Writer writer = new StringWriter ( ) ; try { toXML ( xstream , obj , writer ) ; } catch ( final ObjectStreamException e ) { throw e ; } catch ( final IOException e ) { throw new StreamException ( "Unexpected IO error from a StringWriter" , e ) ; } return writer . toString ( ) ; }
target:  Serialize an object including the XStream to a pretty-printed XML String.