Map<Object,Object> result = new HashMap<Object,Object>();
if (xml != null)
{
Element[] children = XmlUtils.getAllElements(xml);
Serializer objectDeserializer = SerializerRegistry.getInstance().getSerializer(Object.class);
for (Element entry : children)
{
Element[] keysAndValues = XmlUtils.getAllElements(entry);
Object key = null;
Object value = null;
for (Element element : keysAndValues)
{
if (Names.KEY.equals(element.getLocalName()))
{
key = _stringSerializer.fromXML(element);
} else if (Names.VALUE.equals(element.getLocalName()))
{
value = objectDeserializer.fromXML(element);
}
}
result.put(key, value);
}
}