public static void writeSetXml(Set val, OutputStream out) throws XmlPullParserException, IOException {
        XmlSerializer serializer = Xml.newSerializer();
        serializer.setOutput(out, StandardCharsets.UTF_8.name());
        serializer.startDocument(null, true);
        serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
        writeSetXml(val, null, serializer);
        serializer.endDocument();
    }
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