:) You are not counting the depth of the xml file, you are counting the nodes (not all, but nearly). What you have to do is sth similar to Depth-First-Search. You have to travel each path from root to leaf determining the length and check if this is bigger than all length of all paths in your tree. Found an example in Java, doing exactly what you need: http://www.sourcecodesworld.com/articles/java/java-data-structures/Determining_Tree_Depth.asp[^] Take a look at the method _getdepth(). What the code does is to get the depth for each subtree and then compares these values, checking if it is bigger than all seen before. Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.