private static void addUserMetaDataIfNotNull(XmlWriter xml, List<MetadataEntry> userMetadata) {
        if (userMetadata == null || userMetadata.isEmpty()) {
            return;
        }

        xml.start("UserMetadata");
        for(MetadataEntry metadataEntry: userMetadata) {
            xml.start("MetadataEntry");
            addIfNotNull(xml, "Name", metadataEntry.getName());
            addIfNotNull(xml, "Value", metadataEntry.getValue());
            xml.end();
        }
        xml.end();
    }
Converts the SelectObjectContentRequest to an XML fragment that can be sent to
the SelectObjectContent operation of Amazon S3.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/RequestXmlFactory.java