package org.dasein.cloud.azure.storage.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.namespace.QName;
import org.w3c.dom.Element;

public class MapAdapter extends XmlAdapter<MapWrapper, Map<String, String>> {
    
	@Override
    public MapWrapper marshal(Map<String, String> m) throws Exception {
        MapWrapper wrapper = new MapWrapper();
        List<JAXBElement<String>> elements = new ArrayList<JAXBElement<String>>();
        if (m != null && !m.isEmpty()) {
	        for (Entry<String, String> property : m.entrySet()) {
	            elements.add(new JAXBElement<String>(new QName(property.getKey()), 
	                    String.class, property.getValue().toString()));
	        }
        }
        wrapper.elements = elements;
        return wrapper;
    }

    @Override
    public Map<String, String> unmarshal(MapWrapper v) throws Exception {
    	Map<String, String> map = new HashMap<String, String>();
    	if (v != null && v.elements != null && !v.elements.isEmpty()) {
	    	for (Object object : v.elements) {
	    		Element element = (Element) object;
	    		map.put(element.getNodeName(), element.getNodeValue());
	    	}
    	}
    	return map;
    }

}

class MapWrapper {
    @XmlAnyElement
    List elements;
}
@@ -167,16 +167,17 @@
 .Entry;%0A
+%0A
 import j
@@ -339,16 +339,17 @@
 .QName;%0A
+%0A
 import o
@@ -1364,17 +1364,19 @@
 .get
-NodeValue
+TextContent
 ());
@@ -1459,17 +1459,50 @@
 ment
-%0A    List
+(lax = true)%0A    List%3CJAXBElement%3CString%3E%3E
  ele

Update azure blob store UT, change unmarshal