So logically what you are doing is:
for each person
list all superiors in ascending order
Translated into XSLT that is
<!-- given a position, output its title
and then recurse to process the superiors -->
<xsl:template match="person">
<xsl:value-of select="."/>
<xsl:apply-templates select="f:superior(.)"/>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="//person"/>
</xsl:template>
<xsl:function name="f:superior">
<xsl:param name="person" as="element(person)"/>
<xsl:sequence select="key('r', @reportsto)"/>
</xsl:function>
<xsl:key name="r" match="person" select="."/>
No grouping involved.
If this is the logic, then you can do the numbering by passing a parameter on the recursive apply-templates call and incrementing its value on each call.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference