Acknowledgements
Many of the examples in this tutorial are taken directly from the
XSLT 2.0 Specification.
Jeni Tennison’s Typing in Transformations paper
from Extreme Markup Languages 2003 was instrumental
in refreshing my memory about the issues surrounding XPath 2.0 casting rules.