public static void setProperties(Element element, String name, String[] values) {
        String[] propName = parsePropertyName(name);
        setProperty(element, name, values[0]);

        // Search for this property by traversing down the XML hierarchy, stopping one short.
        int i = propName[0].equals(element.getName()) ? 1 : 0;
        for (; i < propName.length - 1; i++) {
            element = element.element(propName[i]);
            if (element == null) {
                // This node doesn't match this part of the property name which
                // indicates this property doesn't exist so return empty array.
                return;
            }
        }
        String childName = propName[propName.length - 1];
        // We found matching property, clear all children.
        Iterator<Element> iter = element.elementIterator(childName);
        while (iter.hasNext()) {
            iter.next().detach();
        }
        for (int j = 0; i < values.length; i++) {
            if (values[j] != null) {
                element.addElement(childName).setText(values[j]);
            }
        }
    }
Sets a property to an array of values.  You MAY NOT use the attribute
markup (using a ':' in the last element name) with this call. Multiple values matching the
same property is mapped to an XML file as multiple elements containing each value.
For example, using the name "foo.bar.prop", and the value string array containing
{"some value", "other value", "last value"} would produce the following XML:
<pre>
&lt;foo&gt;
    &lt;bar&gt;
        &lt;prop&gt;some value&lt;/prop&gt;
        &lt;prop&gt;other value&lt;/prop&gt;
        &lt;prop&gt;last value&lt;/prop&gt;
    &lt;/bar&gt;
&lt;/foo&gt;
</pre>

@param element the element to set the properties on
@param name   the name of the property.
@param values The array of values for the property (can be empty but not null)
xmppserver/src/main/java/org/jivesoftware/util/ElementUtil.java