'Parse challenge and send response from the mechanism.
@param element: the challenge protocol element.
@type element: L{domish.Element}.'

def onChallenge(self, element):

    try:
        challenge = fromBase64(unicode(element))
    except SASLIncorrectEncodingError:
        self._deferred.errback()
    else:
        self.sendResponse(self.mechanism.getResponse(challenge))
