title: Need help on tree like structure data retrieval
body: <p>I have an 'superior object' of type HierarchyNode which will have childnodes (each child node may have their child nodes) of it of the sametype HierarchyNode.</p>
  
  <p>I should read the childnodes of reqested parent node from the 'superior object'. So my code goes as follow (caller -- superiorObject.IdentifySubNodeOfRequestedNode(...)). But stopRecursiveCall is false in foreach loop eventhough if loop is executed and also getting not all code return values exception. How to resolve this and return childnodes or is there anyother better solution to this problem? Thanks</p>
  
  <pre><code>public List&lt;HierarchyNode&gt; IdentifySubNodeOfRequestedNode(int reqstedId, Boolean stopRecursiveCall)
  {
      if (this.UserId == reqstedId)
      {
          stopRecursiveCall = true;
          return this.ChildNodes;
      }
  
      foreach (HierarchyNode childNode in this.ChildNodes)
      {
           childNode.IdentifySubNodeOfRequestedNode(reqstedId, stopRecursiveCall);
           if (stopRecursiveCall)
               break;
      }
  }
  </code></pre>