title: jquery ajax response, traverse XML to build nested menu tree
body: <p>I am going nuts trying to figure this out, I am trying to build a simple menu tree with multi levels</p>
  
  <pre><code>RootFolder
  - First Sub Folder
  -- First Sub Sub Folder
  --- First Sub Sub Sub Folder
  --- First Sub Sub Sub Sub Folder
  - Second Sub Folder
  - Second Sub Sub Folder
  </code></pre>
  
  <p>My XML is very simple (not the right values)</p>
  
  <pre><code>&lt;OrgFolderDetails&gt;
      &lt;FolderName&gt;Main Folder&lt;/FolderName&gt;
      &lt;TheChildren&gt;
          &lt;OrgFolderDetails&gt;
              &lt;FolderName&gt;First Sub Folder&lt;/FolderName&gt;
              &lt;TheChildren&gt;
                  &lt;OrgFolderDetails&gt;
                      &lt;FolderName&gt;First Sub Sub Folder&lt;/FolderName&gt;
                      &lt;TheChildren&gt;
                          &lt;OrgFolderDetails&gt;
                              &lt;FolderName&gt;First Sub Siub Sub Folder&lt;/FolderName&gt;
                              &lt;TheChildren&gt;
                                  &lt;OrgFolderDetails&gt;
                                      &lt;FolderName&gt;First Sub Sub Sub Sub Folder&lt;/FolderName&gt;
                                      &lt;TheChildren/&gt;
                                  &lt;/OrgFolderDetails&gt;
                              &lt;/TheChildren&gt;
                          &lt;/OrgFolderDetails&gt;
                      &lt;/TheChildren&gt;
                  &lt;/OrgFolderDetails&gt;
              &lt;/TheChildren&gt;
          &lt;/OrgFolderDetails&gt;
          &lt;OrgFolderDetails&gt;
              &lt;FolderName&gt;Second Sub Folder&lt;/FolderName&gt;
              &lt;TheChildren&gt;
                  &lt;OrgFolderDetails&gt;
                      &lt;FolderName&gt;Second Sub Sub Folder&lt;/FolderName&gt;
                      &lt;TheChildren/&gt;
                  &lt;/OrgFolderDetails&gt;
              &lt;/TheChildren&gt;
          &lt;/OrgFolderDetails&gt;
      &lt;/TheChildren&gt;
  &lt;/OrgFolderDetails&gt;
  </code></pre>
  
  <p>I have used jQuery's .filter() and. find() each() without any success, it doesn't give me the nice dashes to indicate which level I am in, it just spits out the folder names.</p>
  
  <p>My code that traverses</p>
  
  <pre><code> $(data).find("FolderName").each(function(){
               var folderName = $(this).text();
  
              $("#folderLevels").append(folderName+"&lt;br/&gt;");
           });
  </code></pre>