@Nonnull
    public static Set<Namespace> getPrefixedNamespacesOnCurrentElement(XmlPullParser xpp) throws XmlPullParserException
    {
        final Set<Namespace> results = new HashSet<>();
        final int nsStart = xpp.getNamespaceCount(xpp.getDepth()-1);
        final int nsEnd = xpp.getNamespaceCount(xpp.getDepth());
        for (int i = nsStart; i < nsEnd; i++) {
            final String prefix = xpp.getNamespacePrefix(i);
            final String ns = xpp.getNamespaceUri(i);
            if (prefix != null && !XMPPPacketReader.IGNORED_NAMESPACE_ON_STANZA.contains(ns) && !"http://etherx.jabber.org/streams".equals(ns)) {
                results.add(Namespace.get(prefix, ns));
            }
        }
        return results;
    }
Retrieves a collection of namespaces declared in the current element that the parser is on, that are not defined
in {@link #IGNORED_NAMESPACE_ON_STANZA}, is not "http://etherx.jabber.org/streams" and that are not the default
namespace (the namespaces returned all have a defined prefix).

@param xpp the parser
@return A collection of namespaces
@throws XmlPullParserException On any problem thrown by the XML parser.
xmppserver/src/main/java/org/dom4j/io/XMPPPacketReader.java