@Override
    public void writeStringSavableMap(Map<String, ? extends Savable> map, String name, Map<String, ? extends Savable> defVal) throws IOException {
        if (map == null || map.equals(defVal)) {
            return;
        }

        Element stringMap = appendElement(name);

        Iterator<String> keyIterator = map.keySet().iterator();
        while(keyIterator.hasNext()) {
            String key = keyIterator.next();
            Element mapEntry = appendElement("MapEntry");
            XMLUtils.setAttribute(mapEntry, "key", key);
            Savable s = map.get(key);
            write(s, "Savable", null);
            currentElement = stringMap;
        }

        currentElement = (Element) stringMap.getParentNode();
    }
appends a new Element with the given name to currentElement, sets
currentElement to be new Element, and returns the new Element as well
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMOutputCapsule.java