I think you need to explain more clearly what you want to achieve, and what environment you are working in. Try to describe your problem, not your proposed solution.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference