title: XSLT and nested elements
body: <p>Given the XSL template and XML below, here's the HTML output i'm trying to achieve (more or less):</p>
  
  <pre><code>&lt;p&gt;
  foo goes here
    &lt;span class="content"&gt;&lt;p&gt;blah blah blah&lt;/p&gt;&lt;p&gt;blah blah blah&lt;/p&gt;&lt;/span&gt;
  bar goes here
    &lt;span class="content"&gt;blah blah blah blah blah blah&lt;/span&gt; 
  &lt;/p&gt;
  </code></pre>
  
  <p>Here is what is actually getting rendered (entire contents of &lt;span.content> missing):</p>
  
  <pre><code>&lt;p&gt;
  foo goes here
    &lt;span class="content"&gt;&lt;/span&gt;
  bar goes here
    &lt;span class="content"&gt;blah blah blah blah blah blah&lt;/span&gt; 
  &lt;/p&gt;
  </code></pre>
  
  <p>Here's my template (snippet):</p>
  
  <pre><code> &lt;xsl:template match="note[@type='editorial']"&gt;
     &lt;span class="content"&gt;
       &lt;xsl:apply-templates /&gt;
     &lt;/span&gt;
   &lt;/xsl&gt;
   &lt;xsl:template match="p"&gt;
     &lt;p&gt;
       &lt;xsl:apply-templates /&gt;
     &lt;/p&gt;
   &lt;/xsl&gt;
  </code></pre>
  
  <p>Here's my xml:</p>
  
  <pre><code>&lt;p&gt;
  foo goes here
    &lt;note type="editorial"&gt;&lt;p&gt;blah blah blah&lt;/p&gt;&lt;p&gt;blah blah blah&lt;/p&gt;&lt;/note&gt;
  bar goes here
    &lt;note type="editorial"&gt;blah blah blah blah blah blah&lt;/note&gt; 
  &lt;/p&gt;
  </code></pre>
  
  <p><strong>Rendering particular elements is not important.</strong> ie. I don't care whether a &lt;p> or &lt;div> or &lt;span> gets rendered, so long as none of the text elements are lost.
  I would like to avoid creating a specific rule to match "p/note/p", assuming that a &lt;note> element can contain any arbitrary children.</p>
  
  <p>I'm a total noob to xsl, so any additional tips or pointers would be really helpful.</p>
  
  <p>Thanks in advance.</p>