title: Access XML Import: Issue with nested nodes
body: <p>I've been trying to import an XML file with an xsl to transform the file for a while with no success. 
  Here is a sample of the XML data:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
   &lt;Catalog&gt;
    &lt;Category1&gt;
     &lt;Name&gt;Category1&lt;/Name&gt;
     &lt;Site&gt;
       &lt;Id&gt;IDOfCategory1&lt;/Id&gt;
       &lt;Title&gt;&lt;[Title]&gt;&lt;/Title&gt;
     &lt;/Site&gt;
     &lt;SubCategory1&gt;
     &lt;Name&gt;SubCategory1Category1&lt;/Name&gt;
     &lt;Site&gt;
       &lt;Id&gt;IDSubCat1Cat1&lt;/Id&gt;
       &lt;Title&gt;&lt;![Title]&gt;&lt;/Title&gt;
     &lt;/Site&gt;
     &lt;/SubCategory1&gt;
     &lt;SubCategory2&gt;
     &lt;Name&gt;SubCategory2Category1&lt;/Name&gt;
     &lt;Site&gt;
       &lt;Id&gt;IDSubCat2Cat1&lt;/Id&gt;
       &lt;Title&gt;&lt;![Title]&gt;&lt;/Title&gt;
     &lt;/Site&gt;
     &lt;/SubCategory2&gt;
   &lt;/Category1&gt;
   &lt;Category2&gt;
    &lt;Name&gt;Category2&lt;/Name&gt;
   &lt;Site&gt;
    &lt;Id&gt;IDOfCategory2&lt;/Id&gt;
    &lt;Title&gt;&lt;[Title]&gt;&lt;/Title&gt;
    &lt;/Site&gt;
   &lt;SubCategory1&gt;
    &lt;Name&gt;SubCategory1Category2&lt;/Name&gt;
    &lt;Site&gt;
      &lt;Id&gt;IDSubCat1Cat2&lt;/Id&gt;
      &lt;Title&gt;&lt;![Title]&gt;&lt;/Title&gt;
     &lt;/Site&gt;
   &lt;/SubCategory1&gt;
   &lt;SubCategory2&gt;
    &lt;Name&gt;SubCategory2Category2&lt;/Name&gt;
    &lt;Site&gt;
      &lt;Id&gt;IDSubCat2Cat2&lt;/Id&gt;
      &lt;Title&gt;&lt;![Title]&gt;&lt;/Title&gt;
     &lt;/Site&gt;
   &lt;/SubCategory2&gt;
   &lt;/Category2&gt;
   &lt;/Catalog&gt;
  </code></pre>
  
  <p>What I need is this:</p>
  
  <pre><code>Category  SubCategory
  ---------  --------  
  Category1 SubCategory1OfCategory1
  Category1 SubCategory2OfCategory1  
  Category2 SubCategory1OfCategory2                                  
  Category2 SubCategory2OfCategory2
  </code></pre>
  
  <p>I tried several ways, the closest one was this one, but it's putting all Category1 in the first column and never change to Category2.</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output indent="yes"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
  
  &lt;xsl:template match="@*|node()"&gt;
      &lt;xsl:copy&gt;
          &lt;xsl:apply-templates select="@*|node()"/&gt;
      &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="SubCategory"&gt;
  &lt;SubCategory&gt;
          &lt;Category&gt;&lt;xsl:value-of select="../../Category/Name"/&gt;&lt;/Category&gt;
          &lt;xsl:apply-templates select="@*|node()"/&gt;
  &lt;/SubCategory&gt;        
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I read some other solutions about this topic, that is how I reached this closest solution, but not far..I've been trying for several hours (two days...) and I am close to quit, so, any help will be appreciate.
  Thank you!</p>
  
  <p>I made this today:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="html" version="4.0" indent="yes"/&gt;
  
  &lt;xsl:template match="dataroot"&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;table&gt;
  &lt;xsl:apply-templates select="Catalog"/&gt;
  &lt;/table&gt;
  &lt;/body&gt;
   &lt;/html&gt;
   &lt;/xsl:template&gt;
  
  &lt;xsl:template match="Catalog"&gt;
  &lt;Categories&gt;
  
  &lt;Category&gt;
  &lt;xsl:value-of select="Category/Name"/&gt;
  &lt;/Category&gt;
  
  &lt;SubCategory&gt;
  &lt;xsl:value-of select="Category/SubCategory/Name"/&gt;
  &lt;/SubCategory&gt;
  &lt;/Categories&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>This put only the first Category and the first SubCategory, nothing more than that.
  I also tried the xsl:for-each before Categories, then after, then inside Category only, but it is not working...</p>