title: How to use XSLT recursion to convert any xml data to a html table view:
body: <p>For a given xml, I need to generate a html table to represent the values in the xml.
  I need the recursion for any keyN, if valueN is text then just print it. If valueN is xml, then print a (nested)table with it's value. I think my lack of understanding of how to use XSLT recursion correctly is the base of the question. Any help appreciated. </p>
  
  <p>Input:</p>
  
  <pre><code>&lt;root&gt;
      &lt;key1&gt; Text Value  &lt;/key1&gt;
  &lt;key2&gt; 
      &lt;a&gt; aaa &lt;/a&gt;
      &lt;b&gt; bbb &lt;/b&gt;
  &lt;/key2&gt;
  &lt;keyN&gt; valueN &lt;/keyN&gt;
  &lt;root&gt;
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>&lt;table border="1px"&gt;
      &lt;tr&gt;
          &lt;td&gt; key1 &lt;/td&gt;
          &lt;td&gt; Text Value &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt;
          &lt;td&gt; key2 &lt;/td&gt;
          &lt;td&gt;
              &lt;table border="1px"&gt;
                  &lt;tr&gt; &lt;td&gt; a &lt;/td&gt; &lt;td&gt; aaa &lt;/td&gt; &lt;/tr&gt;
                  &lt;tr&gt; &lt;td&gt; b &lt;/td&gt; &lt;td&gt; bbb &lt;/td&gt; &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr&gt; 
          &lt;td&gt; keyN &lt;/td&gt;
          &lt;td&gt;
              valueN (if valueN is text)
                      OR
              &lt;table&gt; ... &lt;/table&gt; (if valueN is xml)
          &lt;td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>