build the tree into a html hierarchy.