I would write the function as
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mf="http://example.org/mf"
exclude-result-prefixes="xs mf">
<xsl:function name="mf:find_num" as="xs:integer*">
<xsl:param name="input" as="xs:string"/>
<xsl:analyze-string select="$input" regex="[0-9]+">
<xsl:matching-substring>
<xsl:sequence select="xs:integer(.)"/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:function>
<xsl:template match="address">
<xsl:value-of select="mf:find_num(.)" separator=", "/>
</xsl:template>
</xsl:stylesheet>
Of course converting to xs:integer
is optional, if you want the function to return a sequence of strings containing digits you would simply change it to do
<xsl:function name="mf:find_num" as="xs:string*">
<xsl:param name="input" as="xs:string"/>
<xsl:analyze-string select="$input" regex="[0-9]+">
<xsl:matching-substring>
<xsl:sequence select="."/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:function>