'Clean up observers, parse the failure and errback the deferred.
@param failure: the failure protocol element. Holds details on
the error condition.
@type failure: L{domish.Element}'

def onFailure(self, failure):

    self.xmlstream.removeObserver('/challenge', self.onChallenge)
    self.xmlstream.removeObserver('/success', self.onSuccess)
    try:
        condition = failure.firstChildElement().name
    except AttributeError:
        condition = None
    self._deferred.errback(SASLAuthError(condition))
