'A shortcut method for registering a handler using XML masks.
The use of :meth:`register_handler()` is preferred.
:param mask: An XML snippet matching the structure of the
stanzas that will be passed to this handler.
:param pointer: The handler function itself.
:parm name: A unique name for the handler. A name will
be generated if one is not provided.
:param disposable: Indicates if the handler should be discarded
after one use.
:param threaded: **DEPRECATED**.
Remains for backwards compatibility.
:param filter: **DEPRECATED**.
Remains for backwards compatibility.
:param instream: Indicates if the handler should execute during
stream processing and not during normal event
processing.'

def add_handler(self, mask, pointer, name=None, disposable=False, threaded=False, filter=False, instream=False):

    if (name is None):
        name = (u'add_handler_%s' % self.new_id())
    self.register_handler(XMLCallback(name, MatchXMLMask(mask, self.default_ns), pointer, once=disposable, instream=instream))
