title: C# Passing XML as Parameter to XSLT
body: <p>I am trying to insert some XML nodes (plus child nodes) into an XSLT transformed document. I have the XML as a string, and so at first I passed this string in and simply printed it. However, all the <code>&lt;</code>s and <code>&gt;</code>s were escaped as <code>&amp;lt;</code> and <code>&amp;gt;</code> and so I realized that an XML parser would ignore these and not recognize the string as XML nodes. </p>
  
  <p>I tried first writing the string to a file, and then loading it up using the document() function. However, this resulted in the error: <code>Resolving of external URIs was prohibited.</code> I also realized that due to the sensitive nature of the documents being transformed this could pose a serious risk, as anybody could write a file with whatever they liked to that location and it would potentially be picked up and inserted into the output XML.</p>
  
  <p>So, I tried passing the XML in as a URI with <code>data:text/xml</code> appended to it, as the document function is supposed to be able to parse and load URIs of this kind. However, this has resulted in the same error: <code>Resolving of external URIs was prohibited.</code></p>
  
  <p>My <code>XslCompiledTransform</code> object is being instantiated correctly, as far as I know. XsltSettings are set to allow the document() function to be used, and I have passed in the XmlUrlResolver object.</p>
  
  <pre><code>            var xslt = new XslCompiledTransform(true);
  
              var resolver = new XmlUrlResolver();
  #if DEBUG
              xslt.Load(Location, new XsltSettings(true, true), resolver);
  #else
              xslt.Load(XmlReader.Create(new StringReader(this.Text)), new XsltSettings(true, true), resolver);
  #endif
  </code></pre>
  
  <p>I am at somewhat of a loss here. Really, the ideal would be to have a way to pass in the string and tell the Transformation Processor not to escape the <code>&lt;</code>s and <code>&gt;</code>s. Is there a way to do this?</p>