Saxon-EE under appropriate circumstances will compile an xsl:choose instruction (or an equivalent sequence of if/then/else if expressions) into a switch expression. This is done when all the test conditions take the form test="X = N" with the same expression X in each case, and with N being an atomic literal value. X will then be evaluated once, and a hash table will be used to determine which branch to take. However, if the value of X is an empty sequence, a null pointer exception occurs.
A patch is being raised in the private Subversion repository for both the 9.1 and 9.2 branches.