Easy in 2.0 - you can use regular expressions, or test "$x castable as xs:integer".
In 1.0 you can play tricks with translate:
translate($x, '0123456789', '') = ''
will be true only if all characters in $x are digits.
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference