The Saxon-SA serial processing feature cannot handle a
selection containing the union operator.
The documentation of this feature at
says "The path expression introduced by the call on
document() or doc must conform to the rules for path
expressions appearing in identity constraints in XML
Schema.". XML Schema allows the path to be a union.
Saxon attempts to use the serial processing feature if
the path is a union that XML Schema would permit, but
fails at run-time with a ClassCastException.
(At the time of writing, I have not decided whether to
fix this by allowing unions or by disallowing them.
There are clearly use cases where it would be useful to