Add conversion functions for our own tree format.