Consider the following XSLT script:
A posting by M. David Peterson just taught me how to make this work:
It's not necessary to have an for this case. Instead, I can embed the data document directly into the XSL stylesheet (putting it into a namespace for sanity) and then select elements from that. Here's the result:
red rot
green gruen
blue blau
This generates the expected output redgreenblue.
The trick is to use document('') to get a handle to the XSLT document itself, then * to get into the toplevel xsl:stylesheet element and from there I can access the color map.