public static Element getSASLMechanisms( LocalSession session )
    {
        if ( session instanceof ClientSession )
        {
            return getSASLMechanismsElement( (ClientSession) session );
        }
        else if ( session instanceof LocalIncomingServerSession )
        {
            return getSASLMechanismsElement( (LocalIncomingServerSession) session );
        }
        else
        {
            Log.debug( "Unable to determine SASL mechanisms that are applicable to session '{}'. Unrecognized session type.", session );
            return null;
        }
    }
Returns an XML element with the valid SASL mechanisms available for the specified session. If
the session's connection is not secured then only include the SASL mechanisms that don't
require TLS.

@param session The current session

@return The valid SASL mechanisms available for the specified session.
xmppserver/src/main/java/org/jivesoftware/openfire/net/SASLAuthentication.java