javadoc wrote: toXML public void toXML(java.lang.Object obj, java.io.Writer writer) Serialize an object to the given Writer as pretty-printed XML.