Fix tree structure. Add methods for scaning xml-based trees.