title: Parsing XML with XPath in Java
body: <p>I have a XML with a structure similar to this:</p>
  
  <pre><code>&lt;category&gt;
     &lt;subCategoryList&gt;
        &lt;category&gt;
  
        &lt;/category&gt;
        &lt;category&gt;
           &lt;!--and so on --&gt;
        &lt;/category&gt;
     &lt;/subCategoryList&gt;
  &lt;/category&gt;
  </code></pre>
  
  <p>I have a Category class that has a <code>subcategory</code> list (<code>List&lt;Category&gt;</code>). I'm trying to parse this XML file with XPath, but I can't get the child categories of a category.  </p>
  
  <p>How can I do this with XPath? Is there a better way to do this?</p>