Just tried to answer the following question:
Unfortunately, it is impossible to add a legit and working XSLT with embedded c# code.
Both, directly as well as an attachment.
Again, it seems that the CDATA section is not passing your validation.
Please take a look into it.