DataPower has a XSLT 1.0 processor since day 1 long ago (1999), and that provides XPath 1.0.
(There is a wealth of EXSLT as well as DataPower proprietary extension functions/elements)

With 6.0.0.0 firmware DataPower shipped XQuery 1.0 processor as well, and that provides XPath 2.0.
Any valid XPath 2.0 statement is a valid XQuery script by definition.
And there is a HUGE amount of functions and operators in XPath 2.0 (more than 250):http://www.w3.org/TR/xpath-functions/

With 7.0.0.0 firmware released last Friday we got much new exciting stuff (I blogged on GatewayScript before).

In my January posting on TOhtml tool for creating the nicely syntax-highlighted source code listings I use in my blog (based on vi's (my favorite editor) TOhtml command), I showed the "answer" to Shakespeare's question from a C- or Java-programmer's perspective:

allowed for switching on node-type -- with the help of Michael I got this right.It is a little tricky to check whether a given node is a namespace node or attribute, have a look.This node-type switcher is also part of xpath++ tool

This function just returns the node-type as string, and below stylesheet node-kind.xsl does implement this for DataPower use.See this sample execution with a testcase for each return value, taken from the stylesheet itself (see "document('')" ):

... the total precision is therefore 53 bits (approximately 16 decimal digits). ...... For the next range, from 253 (=9,007,199,254,740,992) to 254, everything is multiplied by 2, ...

Below you can see the output of DataPower, xsltproc, xalan and saxon XSLT processors for numbers with 15 to 18 digits.Reported is the length, the conversion of the input string to number (by XSLT core function number()) as well as the original input string.The last 16 digit number is the lowest (positive) integer with precision loss: