private static List<String> getNames( String type, Document webXml )
    {
        Log.trace("Looking for {} names", type);
        final List<String> result = new ArrayList<>();
        final List<Element> elements = webXml.getRootElement().elements( type ); // all elements of 'type' (filter or servlet).
        for ( final Element element : elements )
        {
            final String name = element.elementTextTrim( type + "-name" );
            if ( name != null && !name.isEmpty() )
            {
                result.add( name );
            }
        }

        Log.debug("Found {} {} name(s): {}", result.size(), type, String.join(", ", result));
        return result;
    }
Retrieves the names of all filters from a web.xml document.

Returns a list that contains 'message' from this web.xml document:
&lt;filter&gt;
  &lt;filter-name&gt;message&lt;/filter-name&gt;
  &lt;filter-class&gt;com.acme.filter.MessageFilter&lt;/filter-class&gt;
&lt;/filter&gt;

@param webXml web.xml document, parsed as XML (cannot be null)
@return The name of the filter class, or null when no such class was defined.
xmppserver/src/main/java/org/jivesoftware/util/WebXmlUtils.java