'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
    numPops = 0
    mostRecentTag = None
    for i in range((len(self.tagStack) - 1), 0, (-1)):
        if ((name == self.tagStack[i].name) and (nsprefix == self.tagStack[i].prefix)):
            numPops = (len(self.tagStack) - i)
            break
    if (not inclusivePop):
        numPops = (numPops - 1)
    for i in range(0, numPops):
        mostRecentTag = self.popTag()
    return mostRecentTag
