The curious expression
number($x) = number($x)
returns true if $x can be converted to a number, and false if it can't.
Or you can write
string(number($x)) = 'NaN'
if that seems less bizarre.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference