descendant

returns descendant elements.

Source


def descendant(self):
    ret = pyNodeList()
    for node in self:
        d = node.descendant()
        if isinstance(d, pyNodeList) and len(d) != 0:
            ret.extend(d)
        elif isinstance(d, pyNode):
            ret.append(d)
    if len(ret) == 1: return ret[0]
    else: return ret