Classify elements in the tree.