'Returns the nested elements that match the CSS selector chain.'

def search(self, e):

    (m, root) = ([], e)
    for chain in self:
        e = [root]
        for (combinator, s) in chain:
            if (combinator == '    '):
                e = map(s.search, e)
                e = list(itertools.chain(*e))
            if (combinator == '>'):
                e = map((lambda e: filter(s.match, e.children)), e)
                e = list(itertools.chain(*e))
            if (combinator == '<'):
                e = map((lambda e: e.parent), e)
                e = filter(s.match, e)
            if (combinator == '+'):
                e = map(s._next_sibling, e)
                e = filter(s.match, e)
        m.extend(e)
    return m
