<xsl:function name="numseq">
<xsl:param name="ranges"/>
<xsl:sequence select="
for $xrange in tokenize($ranges,',') return
let $x:=tokenize($xrange,'-') return
if(empty($x[2]))then $xrange else
for $xnum in (number($x[1]) to number($x[2])) return
format-number($xnum,$x[1])
"/>
</xsl:function>