Recursively apply a function to nodes up to a certain depth. The function is called for each node after it has been called for that node's children.
For a in-detail description, see post_recursive_to_depth.