Index.xs: WIP Added write_tree_to()