Just found out that libxml doesn’t do tail recursion optimisation on XSLT. Note that this is the version of XSLT which requires you do recursion for even trivial string operations, so I’ve just increased the recursion depth to 1000000 because that’s not insane.