1. A method comprising: in a computer system comprising at least a processor and a memory, generating a XSL (Extensible Stylesheet Language) Transformations (XSLT) and Extensible Markup Language (XML) Path Language (XPath) execution tree for an XSLT stylesheet; determining one or more optimizations for the XSLT and XPath execution tree; applying the one or more optimizations to the XSLT and XPath execution tree; verifying the one or more optimizations in the XSLT and XPath execution tree; making the verified one or more optimizations persistent in an optimized XSLT stylesheet; and transforming one or more source XML documents into one or more result documents using the optimized XSLT stylesheet.