You can store the value of the outer position() in a variable
<xsl:variable name="p" select="position()"/>
and reference it within the inner loop.
However, xsl:number is designed to solve your problem more directly:
<xsl:number level="multiple" count="section"/>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference