How to get a counter inside xsl:for-each loop that would reflect the number of current element processed. For example my source XML is
Try:
Edit - had a brain freeze there, position() is more straightforward!