'Create a new corpus view based on a specified XML file.
Note that the ``XMLCorpusView`` constructor does not take an
``encoding`` argument, because the unicode encoding is
specified by the XML files themselves.
:type tagspec: str
:param tagspec: A tag specification, indicating what XML
elements should be included in the view.  Each non-nested
element that matches this specification corresponds to one
item in the view.
:param elt_handler: A function used to transform each element
to a value for the view.  If no handler is specified, then
``self.handle_elt()`` is called, which returns the element
as an ElementTree object.  The signature of elt_handler is::
elt_handler(elt, tagspec) -> value'

def __init__(self, fileid, tagspec, elt_handler=None):

    if elt_handler:
        self.handle_elt = elt_handler
    self._tagspec = re.compile((tagspec + u'\\Z'))
    u'The    tag    specification    for    this    corpus    view.'
    self._tag_context = {0: ()}
    u'A    dictionary    mapping    from    file    positions    (as    returned    by\n                                            ``stream.seek()``    to    XML    contexts.        An    XML    context    is    a\n                                            tuple    of    XML    tag    names,    indicating    which    tags    have    not    yet\n                                            been    closed.'
    encoding = self._detect_encoding(fileid)
    StreamBackedCorpusView.__init__(self, fileid, encoding=encoding)
