private static boolean isSaslExternalOfferred(Element doc) {
        boolean saslEXTERNALoffered = false;
        if (doc.element("mechanisms") != null) {
            Iterator<Element> it = doc.element("mechanisms").elementIterator();
            while (it.hasNext()) {
                Element mechanism = it.next();
                if ("EXTERNAL".equals(mechanism.getTextTrim())) {
                    saslEXTERNALoffered = true;
                    break;
                }
            }
        }
        return saslEXTERNALoffered;
    }
Creates a dedicated reader for a socket.

@param router     the router for sending packets that were read.
@param connection the connection being read.
@param domainPair the local and remote domains
xmppserver/src/main/java/org/jivesoftware/openfire/net/RespondingServerStanzaHandler.java