title: How to create a table-of-contents with all levels of hierarchy?
body: <p>Given the following XML document:</p>
  
  <pre><code>&lt;Include&gt;
    &lt;Feature Title="A"&gt;
      &lt;Feature Title="1" /&gt;
      &lt;Feature Title="2" /&gt;
    &lt;/Feature&gt;
    &lt;Feature Title="B"&gt;
      &lt;Feature Title="3"&gt;
        &lt;Feature Title="i" /&gt;
        &lt;Feature Title="ii" /&gt;
      &lt;/Feature&gt;
      &lt;Feature Title="4" /&gt;
    &lt;/Feature&gt;
  &lt;/Include&gt;
  </code></pre>
  
  <p>I need to generate a text file that looks like:</p>
  
  <pre><code>; Header
  
  A
  A/1
  A/2
  B
  B/3
  B/3/i
  B/3/ii
  B/4
  </code></pre>
  
  <p>My best attempt at achieving this is the XSL stylesheet:</p>
  
  <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
    &lt;xsl:output method="text" omit-xml-declaration="yes" /&gt;
    &lt;xsl:strip-space elements="*" /&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;xsl:text&gt;; Header&amp;#x0A;&amp;#x0D;&amp;#x0A;&amp;#x0D;&lt;/xsl:text&gt;
      &lt;xsl:apply-templates select="//Feature" /&gt;&lt;/xsl:template&gt;
  
    &lt;xsl:template match="Feature"&gt;
      &lt;xsl:value-of select="@Title" /&gt;&lt;xsl:text&gt;&amp;#x0A;&amp;#x0D;&lt;/xsl:text&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>But this is generating the output:</p>
  
  <pre><code>; Header
  
  A
  1
  2
  B
  3
  i
  ii
  4
  </code></pre>
  
  <p>How do I get all levels of hierarchy to be present in the output?</p>