convert reduced plan to a tree for UI