XSLT - Find the last item in a loop

Details Needed expression:

<xsl:when test="position() = last()">




Example to find the last item in a loop:



	<xsl:for-each select="address/example/item">

	  <xsl:choose>

	    <xsl:when test="@checked = 'true'">

	      <xsl:choose>

	        <xsl:when test="position() = last()">

	             <xsl:value-of select="."/>

	         </xsl:when>

	         <xsl:otherwise>

	                <xsl:value-of select="."/><xsl:value-of select="', '"/>

	          </xsl:otherwise>

	        </xsl:choose>

	     </xsl:when>

	     <xsl:otherwise>

	     </xsl:otherwise>

	   </xsl:choose>

	</xsl:for-each>