XML:
JAVA Hashmap: map = {key1=text1,key2=text2}
this doesn't work. why?
String xml = "<nodes><node id=\"key1\"><![CDATA[text1]]></node><node id="\key2\"><![CDATA[text2]]></node></nodes>";
XStream xs = new XStream();
xs.alias("nodes", Map.class);
xs.alias("node", String.class);
xs.useAttributeFor("id",String.class);
Map<String,String> map= (Map<String,String>) xs.fromXML(xml);
System.out.println(map);