Thanks go out to Wolfram Kriesing for having put together the following tutorial for the excellent PEAR::Tree package.
For those of you who don’t know, PEAR::Tree is a package that provides methods to read and manipulate trees, which are stored in the DB or an XML file. The trees can be stored in the DB either as nested trees. Or as simple trees, which use parentId-like structure. Currently XML data can only be read from a file and accessed. The package offers a large number of methods to access and manipulate trees. For example methods like: getRoot, getChild[ren], getParent, getPath and many more.
UPDATE: there are a number of sites linking to this page, I’m afraid a link to the cited tutorial is no longer available as the original author removed it.