public static String toJson ( final String xmlString , final Map < String , Class < ? > > aliases ) { final Object object = XmlToObjectExtensions . toObjectWithXStream ( xmlString ) ; final XStream xstream = new XStream ( new JettisonMappedXmlDriver ( ) ) ; if ( aliases != null ) { for ( final Map . Entry < String , Class < ? > > alias : aliases . entrySet ( ) ) { xstream . alias ( alias . getKey ( ) , alias . getValue ( ) ) ; } } final String json = xstream . toXML ( object ) ; return json ; }
Creates from the given xml string a json string .