@Override public JSON convertToJSON(Object rawResponse) { XMLSerializer xmlConverter = new XMLSerializer(); return xmlConverter.read((String) rawResponse); }
/** * xml to json <node><key label="key1">value1</key></node> 转化为 * {"key":{"@label":"key1","#text":"value1"}} * * @param xml * @return */ public static String xmltoJson(String xml) { XMLSerializer xmlSerializer = new XMLSerializer(); return xmlSerializer.read(xml).toString(); }