This is example that shows how create a TreePanel with layers from a map. GeoExt does not provide a LayerTree component. Instead, to create a tree with nodes that represent layers, create a tree with a LayerContainer at the root, or add LayerNodes directly. See also the tree example for a more complex tree configuration
Note that the js is not minified so it is readable. See layercontainer.js.