Repaired the XSLT to the point that it will not fail with errors. Added a test script.