title: Adding <span> tags to all text nodes between custom self closing tags
body: <p>I have a pair of custom self closing tags s1 and s2 defined in namespace x in my xhtml. For each tag pair s1, s2 having the same id, I want to add span tags to all the text nodes between them. Each s1, s2 tag pair have a unique id. i am looking for a XSL based solution for the same. I am using Saxon java processor for XSL. </p>
  
  <p>Sample input:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; 
  &lt;head&gt; 
  &lt;title&gt;This is my title&lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;h1 align="center"&gt; 
    This is my heading 
  &lt;/h1&gt; 
  &lt;p&gt; 
    Sample content Some text here. Some content here. 
  &lt;/p&gt; 
  &lt;p&gt; 
     Here you go. 
  &lt;/p&gt; 
  &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>
  
  <p>Sample Output:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; 
  &lt;head&gt; 
  &lt;title&gt;This is my title&lt;/title&gt; 
  &lt;/head&gt; 
  &lt;body&gt; 
  &lt;h1 align="center"&gt; 
    This &lt;span class="spanClass" id="1"&gt;is my&lt;/span&gt;heading 
  &lt;/h1&gt; 
  &lt;p&gt; 
    Sample content &lt;span class="spanClass" id="2"&gt;Some text here. Some content here.&lt;/span&gt; 
  &lt;/p&gt; 
  &lt;p&gt; 
     &lt;span class="spanClass" id="3"&gt;Here you&lt;/span&gt;go. 
  &lt;/p&gt; 
  &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>