provide list->tree and tree->list