Unfolding and folding of ctree trees