I have an interesting problem:
XML documents I work with can contain arbitrary, embedded XSLT that is meant to provide a navtive source-model view of the XML document.  The problem here is obviously security executing this embedded xslt.  

So, I was thinking a couple of solutions (my environment is java):
1) Cripple the permissions that the java saxon processor has, using the java security policy
2) Perform regex checks on the XSLT to make sure that certain features are not available (think the document function)
3) Could be saxon has a built in feature to turn on a "safe" mode that is just not widely publicized (wishful thinking)

Is it ever safe to arbitrarily execute XSLT code?  One would probably never execute embedded java or ruby code, but is XSLT somehow safer (I'm thinking it's not)?

Thanks for your ideas!