title: XSLT - apply one template to children and another to childern of children
body: <p>I've following structure of xml-file:</p>
  
  <pre><code>&lt;root-element&gt;
      &lt;child1&gt;
          Some text
      &lt;/child1&gt;
      &lt;child2&gt;
          &lt;grandchild&gt;
              Some text
          &lt;/grandchild&gt;
      &lt;/child2&gt;
  &lt;/root-element&gt;
  </code></pre>
  
  <p>My aim is to generate html-output with the aid of a xslt-file. In doing so I want to apply a template to direct children of root element, which outputs the name of the tag as heading 1 and it contents enclosed in &lt;p>&lt;/p>. As to grandchildern, i want to use almost the same template, but to output their names as heading 2.</p>
  
  <p>To make easier to understand what I want here is sample how HTML-Output would look like:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Sample&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Child1&lt;/h1&gt;
          &lt;p&gt;Some text&lt;/p&gt;
  
          &lt;h1&gt;Child2&lt;/h1&gt;
          &lt;h2&gt;Grandchild&lt;/h2&gt;
          &lt;p&gt;Some text&lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now my attempt looks like this: <a href="http://pastebin.com/wKgSLbcE" rel="nofollow">http://pastebin.com/wKgSLbcE</a></p>
  
  <p>But it doesn't work with &lt;xsl:for-each select="./&#42;"> and &lt;xsl:for-each select="././&#42;"> so I want to ask you for help.</p>