'A scoperef is (<blob>, <lpath>). Return the actual elem in
the <blob> ciElementTree being referred to.'

def _elem_from_scoperef(self, scoperef):

    (elem, lpath) = scoperef
    traversed_items = []
    for i in range(len(lpath)):
        lname = lpath[i]
        try:
            child = elem.names[lname]
        except KeyError:
            child = None
            if (i > 0):
                traversed_items[(i - 1)][2].append(elem)
                (i, child) = self._alternative_elem_from_scoperef(traversed_items)
                traversed_items = traversed_items[:i]
            if (child is None):
                self.info('elem    %r    is    missing    lname:    %r', elem, lname)
                raise
            self.info('elem    %r    is    missing    lname:    %r,    found    alternative:    %r', elem, lname, child)
        traversed_items.append((elem, lname, []))
        elem = child
    return elem
