'Called on incoming XML Stanzas.
The very first element received should be a request for handshake.
Otherwise, the stream is dropped with a \'not-authorized\' error. If a
handshake request was received, the hash is extracted and passed to
L{onHandshake}.'

def onElement(self, element):

    if ((element.uri, element.name) == (self.namespace, 'handshake')):
        self.onHandshake(unicode(element))
    else:
        exc = error.StreamError('not-authorized')
        self.xmlstream.sendStreamError(exc)
