@Test public void objectToXml() { User user = new User(); user.setId(1L); user.setName("calvin"); user.getInterests().add("movie"); user.getInterests().add("sports"); String xml = XmlMapper.toXml(user, "UTF-8"); System.out.println("Jaxb Object to Xml result:\n" + xml); assertXmlByDom4j(xml); }
public static String toXml(Object root) { Class clazz = ClassUtil.unwrapCglib(root); return toXml(root, clazz, null); }
XmlMapper { public static String toXml(Object root) { Class clazz = ClassUtil.unwrapCglib(root); return toXml(root, clazz, null); } }
XmlMapper { public static String toXml(Object root) { Class clazz = ClassUtil.unwrapCglib(root); return toXml(root, clazz, null); }  }
XmlMapper { public static String toXml(Object root) { Class clazz = ClassUtil.unwrapCglib(root); return toXml(root, clazz, null); }  static String toXml(Object root); static String toXml(Object root, String encoding); static String toXml(Object root, Class clazz, String encoding); static String toXml(Collection<?> root, String rootName, Class clazz); static String toXml(Collection<?> root, String rootName, Class clazz, String encoding); static T fromXml(String xml, Class<T> clazz); static Marshaller createMarshaller(Class clazz, String encoding); static Unmarshaller createUnmarshaller(Class clazz); }
XmlMapper { public static String toXml(Object root) { Class clazz = ClassUtil.unwrapCglib(root); return toXml(root, clazz, null); }  static String toXml(Object root); static String toXml(Object root, String encoding); static String toXml(Object root, Class clazz, String encoding); static String toXml(Collection<?> root, String rootName, Class clazz); static String toXml(Collection<?> root, String rootName, Class clazz, String encoding); static T fromXml(String xml, Class<T> clazz); static Marshaller createMarshaller(Class clazz, String encoding); static Unmarshaller createUnmarshaller(Class clazz);  }