XSLT » xsl:for-each » select="expression"

The mandatory select attribute provides an expression that specifies which node set is to be processed by the loop. This can simply be a string that is the name of the node. Only one node set can be defined. However, by selecting a parent node, you can access the values of any child node via the template. You can use the position function to return the position number of the node currently being processed (the numbering starts at one). You can use the last function to return the total number of nodes being processed.