'Compare a stanza\'s XML contents to an XPath expression.
If the value of :data:`IGNORE_NS` is set to ``True``, then XPath
expressions will be matched without using namespaces.
.. warning::
In Python 2.6 and 3.1 the ElementTree
:meth:`~xml.etree.ElementTree.Element.find()` method does not
support attribute selectors in the XPath expression.
:param xml: The :class:`~sleekxmpp.xmlstream.stanzabase.ElementBase`
stanza to compare against.'

def match(self, xml):

    if hasattr(xml, 'xml'):
        xml = xml.xml
    x = ET.Element('x')
    x.append(xml)
    return (x.find(self._criteria) is not None)
