public static String javaToXml(Object o) { XStream xStream = new XStream(); xStream.processAnnotations(o.getClass()); return xStream.toXML(o); }