'Pops the tag stack up to and including the most recent
instance of the given tag. If inclusivePop is false, pops the tag
stack up to but *not* including the most recent instqance of
the given tag.'

def _popToTag(self, name, nsprefix=None, inclusivePop=True):

    if (name == self.ROOT_TAG_NAME):
        return
    most_recently_popped = None
    stack_size = len(self.tagStack)
    for i in range((stack_size - 1), 0, (-1)):
        t = self.tagStack[i]
        if ((name == t.name) and (nsprefix == t.prefix)):
            if inclusivePop:
                most_recently_popped = self.popTag()
            break
        most_recently_popped = self.popTag()
    return most_recently_popped
