title: XSL for-each: how to detect last node?
body: <p>I have this simple code:</p>
  
  <pre><code>&lt;xsl:for-each select="GroupsServed"&gt;
    &lt;xsl:value-of select="."/&gt;,&lt;br/&gt;
  &lt;/xsl:for-each&gt;&lt;/font&gt;
  </code></pre>
  
  <p>I'm trying to add a comma for each item added. </p>
  
  <p>This has 2 flaws:</p>
  
  <ol>
  <li>Case of when there's only 1 item: the code would unconditionally add a comma.</li>
  <li>Case of when there's more than 1 item: the last item would have a comma to it.</li>
  </ol>
  
  <p>What do you think is the most elegant solution to solve this?</p>
  
  <p>I'm using XSLT 2.0</p>