public static void writeSetXml(Set val, String name, XmlSerializer out)
            throws XmlPullParserException, IOException {
        if (val == null) {
            out.startTag(null, "null");
            out.endTag(null, "null");
            return;
        }

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

        for (Object v : val) {
            writeValueXml(v, null, out);
        }

        out.endTag(null, "set");
    }
Flatten a List into an XmlSerializer.  The list can later be read back
global readThisListXml().

@param val  The list to be flattened.
@param name Name attribute to include global this list's tag, or null for
            none.
@param out  XmlSerializer to write the list into.
@see #writeListXml(List, OutputStream)
@see #writeMapXml
@see #writeValueXml
@see #readListXml
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/XmlUtils.java