title: How to match text and other nodes in XSLT
body: <p>I am looking for a way to extract a node and copy it to a different location in the output. I was hoping to do this with xsl:analyze-string but wasn't able to because the select expression of xsl:analyze-string doesn't work if the selection is a collection of nodes (for example, a text node, followed by an element, followed by a text node.) It worked only when I modified the input to just have one text node. But my input is entry[2] below, which is not just text. Even if I select entry[2]/p, the text has XML tags in it, which are element nodes in addition to the text. So here is the input XML:</p>
  
  <pre><code>&lt;rows&gt;
      &lt;row&gt;
          &lt;entry&gt;
              &lt;p&gt;ID &lt;varname&gt;IdValue&lt;/varname&gt;&lt;/p&gt;
              &lt;p&gt;Date &lt;varname&gt;date&lt;/varname&gt;&lt;/p&gt;
              &lt;p&gt;sObject &lt;varname&gt;myObj&lt;/varname&gt;&lt;/p&gt;
          &lt;/entry&gt;
          &lt;entry&gt;
              &lt;p&gt;The &lt;varname&gt;IdValue&lt;/varname&gt; argument provides humor.&lt;/p&gt;
              &lt;p&gt;The &lt;varname&gt;date&lt;/varname&gt; argument specifies how young this language is.&lt;/p&gt;
              &lt;p&gt;The &lt;varname&gt;myObj&lt;/varname&gt; argument specifies the darkness of times.&lt;/p&gt;    
          &lt;/entry&gt;   
      &lt;/row&gt;
  &lt;/rows&gt;
  </code></pre>
  
  <p>and here is the desired output XML:</p>
  
  <pre><code>&lt;section&gt;
      &lt;parameters&gt;
          &lt;param&gt;
              &lt;pn&gt;&lt;varname&gt;IdValue&lt;/varname&gt;&lt;/pn&gt;
              &lt;pv&gt;The &lt;varname&gt;IdValue&lt;/varname&gt; argument provides humor.&lt;/pv&gt;
          &lt;/param&gt;
          &lt;param&gt;
              &lt;pn&gt;&lt;varname&gt;date&lt;/varname&gt;&lt;/pn&gt;
              &lt;pv&gt;The &lt;varname&gt;date&lt;/varname&gt; argument specifies how young this language is.&lt;/pv&gt;
          &lt;/param&gt;
          &lt;param&gt;
              &lt;pn&gt;&lt;varname&gt;myObj&lt;/varname&gt;&lt;/pn&gt;
              &lt;pv&gt;The &lt;varname&gt;myObj&lt;/varname&gt; argument specifies the darkness of times.&lt;/pv&gt;
          &lt;/param&gt;
      &lt;/parameters&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>For each varname found in entry[1], how do I find the matching description in entry[2]?</p>