def visit(self, visitor, predicate=None, **kw):
predicate = predicate or bool<EOL>for n in self.walk(**kw):<EOL><INDENT>if predicate(n):<EOL><INDENT>visitor(n)<EOL><DEDENT><DEDENT>
Apply a function to matching nodes in the (sub)tree rooted at self.

:param visitor: A callable accepting a Node object as single argument..
:param predicate: A callable accepting a Node object as single argument and \
returning a boolean signaling whether Node matches; if `None` all nodes match.
:param kw: Addtional keyword arguments are passed through to self.walk.