public static String tran(WorkItem item){ XStream xstream = new XStream(); xstream.setMode(XStream.NO_REFERENCES); xstream.alias("workitem",WorkItem.class); return xstream.toXML(item); } public static String tranJson(WorkItem item){ XStream xstream = new XStream(new JsonHierarchicalStreamDriver()); xstream.setMode(XStream.NO_REFERENCES); xstream.alias("workitem",WorkItem.class); return xstream.toXML(item); }