title: Apache Freemarker - Get repeating nodes along with child nodes
body: <p>I am using Apache Freemarker and I currently want to parse the below xml structure using xPath approach.</p>
  <pre><code>&lt;book&gt;
    &lt;title&gt;Test Book&lt;/title&gt;
    &lt;chapter&gt;
      &lt;title&gt;Ch1&lt;/title&gt;
      &lt;para&gt;p1.1&lt;/para&gt;
      &lt;para&gt;p1.2&lt;/para&gt;
      &lt;para&gt;p1.3&lt;/para&gt;
    &lt;/chapter&gt;
    &lt;chapter&gt;
      &lt;title&gt;Ch2&lt;/title&gt;
      &lt;para&gt;p2.1&lt;/para&gt;
      &lt;para&gt;p2.2&lt;/para&gt;
    &lt;/chapter&gt;
  &lt;/book&gt;
  </code></pre>
  <p>I want to display the child nodes of the <code>chapter</code> node dynamically in the HTML output.
  My desired output would be something like below:</p>
  <pre><code>Ch1
  p1.1
  p1.2
  p1.3
  
  Ch2
  p2.1
  p2.2
  </code></pre>
  <p>Would be great if someone can help me with a code snippet of how to get this using xPath approach.</p>
  <p>I did try with the below approach which is failing:</p>
  <pre><code>&lt;#list xml[&quot;//chapter/child::text()&quot;] as p &gt;
  &lt;p&gt;${p[&quot;title&quot;]}&lt;/p&gt;
  &lt;/#list&gt;
  </code></pre>