public static Elements collect ( Evaluator eval , Element root ) { Elements elements = new Elements ( ) ; NodeTraversor . traverse ( new Accumulator ( root , elements , eval ) , root ) ; return elements ; }
Build a list of elements by visiting root and every descendant of root and testing it against the evaluator .