Suppose your XSLT transform requires run-time parameters, however, you don’t have access to those arguments when you call it. For example, you’re fetching the XML to transform through HTTP GET, or the XPath document () function, all you have is a URL, and that URL doesn’t decompose into the parameters you need.
Then the source document will have to contain the parameters, even if they are orthogonal to the document content.
So you use a variant of the Envelope Pattern to design the source document;
<doc> <params> <param name="foo" value="bar" /> <param name="baz" value="fnord" /> </params> <body> ... </body> </doc>
The source document is wrapped in a container along with the parameters you need at run time.
I’ve nown seen this pattern in three places. We used it at 2Roam to pass parameters between stages of our Web to WAP transcoder, the Google Search Appliance uses it in its XML result format, and Cocoon Lenya uses it to assemble all the components it needs to render a page.