SOAPElement element = SOAPFactory.newInstance().createElement(name);
element.addNamespaceDeclaration("xml-soap", "http://xml.apache.org/xml-soap");
element.setAttribute("xsi:type", "xml-soap:Map");
SOAPElement item = SOAPFactory.newInstance().createElement("item");
for (Map.Entry<?, ?> entry : values.entrySet()) {
item.addChildElement("key").addTextNode(entry.getKey().toString()).setAttribute("xsi:type", "xsd:string");
SOAPElement valueElement = item.addChildElement("value");
if (entry.getValue() == null) {
valueElement.setAttribute("xsi:nil", "true");
} else {
valueElement.addTextNode(entry.getValue().toString()).setAttribute("xsi:type", "xsd:string");