public static String toXml(final Map<String, String> params) {
        XmlWriters writers = XmlWriters.create();
        for (Map.Entry<String, String> param : params.entrySet()){
            if (!Strings.isNullOrEmpty(param.getValue())){
                writers.element(param.getKey(), param.getValue());
            }
        }
        return writers.build();
    }
public static String toXml ( final Map < String , String > params ) { XmlWriters writers = XmlWriters . create ( ) ; for ( Map . Entry < String , String > param : params . entrySet ( ) ) { if ( ! Strings . isNullOrEmpty ( param . getValue ( ) ) ) { writers . element ( param . getKey ( ) , param . getValue ( ) ) ; } } return writers . build ( ) ; }
Map转换为XML
@param params Map参数
@return XML字符串