The attached patch [against 3.2] causes the xslt transform command to error out if the transform does not return an OK state. In particular, this allows you to abort the script if the transform issues a terminate message.
As this changes the behaviour of the command I toyed with making it optional - enabled using configure - but didn't in the end; I am willing to rework the patch in this way if it is more likely to be accepted.
patch file