ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
Map<String, Object> map = new HashMap<String, Object>();
map.put(null, "nullValue");
map.put("foo", "fooValue");
XmlUtils.writeMapXml(map, baos);
InputStream mapInput = new ByteArrayInputStream(baos.toByteArray());
HashMap<String, ?> deserialized = XmlUtils.readMapXml(mapInput);
assertEquals("nullValue", deserialized.get(null));
assertEquals("fooValue", deserialized.get("foo"));