title: jQuery/Ajax detect if child nodes exist
body: <p>Here is what I am looking into doing... I have not found anyone looking for this so I apologize if this is a duplicate that I have missed somewhere.</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>Reading in an XML file. The names of the nodes can be dynamic (they don't always follow the same node names). For instance:</p>
  
  <pre><code>&lt;course_title&gt;&lt;/course_title&gt;
  &lt;course_subtitle&gt;&lt;/course_subtitle&gt;
  </code></pre>
  
  <p>However, they can ALSO have nested nodes within them so it could be</p>
  
  <pre><code>&lt;course_title&gt;
      &lt;course_prefix&gt;
  &lt;/course_title&gt;
  </code></pre>
  
  <p>So with that, I need to be able to detect if in fact there IS a nested node or not. So what I am wondering is, is there a way to detect whether a node has nested children without manually going through the children using something like </p>
  
  <pre><code>$(xmlFile).children().children().children(); //not ideal if you dont know how nested something is
  </code></pre>