In XSLT 2.0, write a function:
<xsl:function name="f:default-number" as="xs:double">
<xsl:param name="node" as="node()?"/>
<xsl:sequence select="if ($node and ($node castable as xs:double))
then number($node) else 0.0e0"/>
</xsl:function>
then apply this function to every node before including it in the summation.
In 1.0, as always, it's the same principle but a lot more tedious.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference