title: Counter inside xsl:for-each loop
body: <p>How to get a counter inside xsl:for-each loop that would reflect the number of current element processed.<br>
  For example my source XML is</p>
  
  <pre><code>&lt;books&gt;
      &lt;book&gt;
          &lt;title&gt;The Unbearable Lightness of Being &lt;/title&gt;
      &lt;/book&gt;
      &lt;book&gt;
          &lt;title&gt;Narcissus and Goldmund&lt;/title&gt;
      &lt;/book&gt;
      &lt;book&gt;
          &lt;title&gt;Choke&lt;/title&gt;
      &lt;/book&gt;
  &lt;/books&gt;
  </code></pre>
  
  <p>What I want to get is:</p>
  
  <pre><code>&lt;newBooks&gt;
      &lt;newBook&gt;
          &lt;countNo&gt;1&lt;/countNo&gt;
          &lt;title&gt;The Unbearable Lightness of Being &lt;/title&gt;
      &lt;/newBook&gt;
      &lt;newBook&gt;
          &lt;countNo&gt;2&lt;/countNo&gt;
          &lt;title&gt;Narcissus and Goldmund&lt;/title&gt;
      &lt;/newBook&gt;
      &lt;newBook&gt;
          &lt;countNo&gt;3&lt;/countNo&gt;
          &lt;title&gt;Choke&lt;/title&gt;
      &lt;/newBook&gt;
  &lt;/newBooks&gt;
  </code></pre>
  
  <p>The XSLT to modify:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;
      &lt;xsl:template match="/"&gt;
          &lt;newBooks&gt;
              &lt;xsl:for-each select="books/book"&gt;
                  &lt;newBook&gt;
                      &lt;countNo&gt;???&lt;/countNo&gt;
                      &lt;title&gt;
                          &lt;xsl:value-of select="title"/&gt;
                      &lt;/title&gt;
                  &lt;/newBook&gt;
              &lt;/xsl:for-each&gt;
          &lt;/newBooks&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>So the question is what to put in place of ???. Is there any standard keyword or do I simply must declare a variable and increment it inside the loop?</p>
  
  <p>As the question is pretty long I should probably expect one line or one word answer :)</p>