title: Apply XSLT on in-memory XML and returning in-memory XML
body: <p>I am looking for a static function in the .NET framework which takes an XML snippet and an XSLT file, applies the transformation in memory, and returns the transformed XML.  </p>
  
  <p>I would like to do this:</p>
  
  <pre><code>string rawXml = invoiceTemplateDoc.MainDocumentPart.Document.InnerXml;
  rawXml = DoXsltTransformation(rawXml, @"c:\prepare-invoice.xslt"));
  
  // ... do more manipulations on the rawXml
  </code></pre>
  
  <p>Alternatively, instead of taking and returning strings, it could be taking and returning XmlNodes.</p>
  
  <p>Is there such a function?</p>