public static Map<String, Object> toMap(String xml){
        xml = xml.replaceAll("(\\r|\\n)", "");
        if (Strings.isNullOrEmpty(xml)){
            return Collections.emptyMap();
        }
        XmlReaders readers = XmlReaders.create(xml);
        return toMap(readers);
    }
public static Map < String , Object > toMap ( String xml ) { xml = xml . replaceAll ( "(\\r|\\n)" , "" ) ; if ( Strings . isNullOrEmpty ( xml ) ) { return Collections . emptyMap ( ) ; } XmlReaders readers = XmlReaders . create ( xml ) ; return toMap ( readers ) ; }
转换微信XML为Map(仅支持2级)
@param xml xml内容
@return Map对象