title: XSLT increment variable
body: <p>I have the following XML</p>
  
  <blockquote>
  <pre><code>&lt;data&gt;
   &lt;records&gt;
     &lt;record name="A record"&gt;
       &lt;info&gt;A1&lt;/info&gt;
       &lt;info&gt;A2&lt;/info&gt;
     &lt;/record&gt;
     &lt;record name="B record"/&gt;
     &lt;record name="C record"&gt;
       &lt;info&gt;C1&lt;/info&gt;
     &lt;/record&gt;
    &lt;/records&gt;
  &lt;/data&gt;
  </code></pre>
  </blockquote>
  
  <p>how can I transform into following output, the problem is how can I count between on record, and record/info?</p>
  
  <pre><code>&lt;div id="1"&gt;
      &lt;p&gt;A record&lt;/p&gt;
      &lt;span id="1"&gt;A1&lt;/span&gt;
      &lt;span id="2"&gt;A2&lt;/span&gt; 
  &lt;/div&gt; 
  &lt;div id="2"&gt;
      &lt;p&gt;C record&lt;/p&gt;   
      &lt;span id="3"&gt;C1&lt;/span&gt; 
  &lt;/div&gt;
  </code></pre>