tree:

deepReverse(tree)

This is a deep version of reverse, reversing the keys at each level of the indicated tree.