'Initiate authentication protocol exchange.
If an initial client response is given in C{data}, it will be
sent along.
@param data: initial client response.
@type data: C{str} or L{None}.'

def sendAuth(self, data=None):

    auth = domish.Element((NS_XMPP_SASL, 'auth'))
    auth['mechanism'] = self.mechanism.name
    if (data is not None):
        auth.addContent((b64encode(data).decode('ascii') or u'='))
    self.xmlstream.send(auth)
