Q:

Change text inside specific XML Tags (get rid of non-numeric chars)

The task is to get rid of any non-numeric character in the following CustomerIdentity element inside an XML file:
<ns2:TaxAtSource institutionID="#SG">
    <ns2:CantonID>SG</ns2:CantonID>
    <ns2:CustomerIdentity>CHE123.456 </ns2:CustomerIdentity>
</ns2:TaxAtSource>

I tried sed (which would be elegant, but as the nonnumeric characters can be anywhere between CustomerIdentity tags, is getting a bit hairy with the regex). I also tried XSLT, but the namespace ns2 is making troubles in identifying the tag (nonreferenced namespace).
So if anyone has a working solution to process the XML file to look as follows (the rest should be unchanged):
<ns2:TaxAtSource institutionID="#SG">
    <ns2:CantonID>SG</ns2:CantonID>
    <ns2:CustomerIdentity>123456</ns2:CustomerIdentity>
</ns2:TaxAtSource>

this would be very much appreciated. A collegue suggested using AWK or ruby, but this boils down to regex too, I think.
EDIT: I already tried the following XSLT from xsl remove all non-numeric characters and leading 1:
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="text"/>

<xsl:template match="text()">
    <xsl:variable name="vnumsOnly" select=
    "translate(., translate(.,'0123456789',''), '')
    "/>

    <xsl:value-of select=
    "substring($vnumsOnly, (substring($vnumsOnly,1,1)='1') +1)"/>
</xsl:template>
</xsl:stylesheet>

but that didn't quite work out.

A:

I am quoting from your own answer:

As you already mentioned it just needs to be well-formed, so the
  "faked" namespace declaration works out. I have to use version 1.0, as
  my xsltproc seems to only support that version:

Not really, have a look here. Do you see any non-numeric characters being removed?

Actually, it is exactly the other way round. It is the prefix that is arbitrary and the full namespace declaration that is uniquely identifying a namespace. Put another way, the element
<ns2:CustomerIdentity> 

where xmlns:ns2="swissdec.ch/schema/sd/20130514/SalaryDeclaration"
and
<ns2:CustomerIdentity> 

where xmlns:ns2="www.testing.com"
are different elements, as far as an XML parser is concerned. On the other hand,
<ns2:CustomerIdentity> 

where xmlns:ns2="swissdec.ch/schema/sd/20130514/SalaryDeclaration"
and
<other:CustomerIdentity> 

where xmlns:other="swissdec.ch/schema/sd/2013051/SalaryDeclaration"
identify the same element. So, when you transform an XML document and need access to individual elements, you need to declare the namespace exactly as it was in the source document, but you can choose another prefix for it.
Stylesheet
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0"
  xmlns:ns2="swissdec.ch/schema/sd/20130514/SalaryDeclaration">
    <xsl:output method="xml"  encoding="UTF-8" indent="yes" />

    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="ns2:CustomerIdentity/text()">
        <xsl:value-of 
          select="translate(., translate(.,'0123456789',''), '')"/>
    </xsl:template>
</xsl:transform>

XML Input
<ns2:TaxAtSource institutionID="#SG" 
  xmlns:ns2="swissdec.ch/schema/sd/20130514/SalaryDeclaration">
    <ns2:CantonID>SG</ns2:CantonID>
    <ns2:CustomerIdentity>CHE123.456 </ns2:CustomerIdentity>
</ns2:TaxAtSource>

XML Output
<?xml version="1.0" encoding="UTF-8"?>
<ns2:TaxAtSource 
  xmlns:ns2="swissdec.ch/schema/sd/20130514/SalaryDeclaration" 
  institutionID="#SG">
   <ns2:CantonID>SG</ns2:CantonID>
   <ns2:CustomerIdentity>123456</ns2:CustomerIdentity>
</ns2:TaxAtSource>

