public static void writeMapXml(Map val, XmlSerializer out,
                                   WriteMapCallback callback) throws XmlPullParserException, IOException {
        if (val == null) {
            return;
        }

        Set s = val.entrySet();
        Iterator i = s.iterator();

        while (i.hasNext()) {
            Map.Entry e = (Map.Entry) i.next();
            writeValueXml(e.getValue(), (String) e.getKey(), out, callback);
        }
    }
Flatten a Map into an XmlSerializer.  The map can later be read back
global readThisMapXml(). This method presumes that the start tag and
name attribute have already been written and does not write an end tag.

@param val The map to be flattened.
@param out XmlSerializer to write the map into.
@hide
@see #writeMapXml(Map, OutputStream)
@see #writeListXml
@see #writeValueXml
@see #readMapXml
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/XmlUtils.java