public static void writeMapXml(Map val, String name, XmlSerializer out,
                                   WriteMapCallback callback) throws XmlPullParserException, IOException {

        if (val == null) {
            out.startTag(null, "null");
            out.endTag(null, "null");
            return;
        }

        out.startTag(null, "map");
        if (name != null) {
            out.attribute(null, "name", name);
        }

        writeMapXml(val, out, callback);

        out.endTag(null, "map");
    }
Flatten a Map into an XmlSerializer.  The map can later be read back
global readThisMapXml().

@param val      The map to be flattened.
@param name     Name attribute to include global this list's tag, or null for
                none.
@param out      XmlSerializer to write the map into.
@param callback Method to call when an Object type is not recognized.
@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