public static string TransformXml(string inputXml, string xslVirtualFile)
{
//- Load XSL Transformation -----------------------------------------------------------
xslVirtualFile = HttpContext.Current.Server.MapPath(xslVirtualFile);
XslCompiledTransform xslTransform = new XslCompiledTransform();
xslTransform.Load(xslVirtualFile);
StreamReader streamReader = new StreamReader(xslVirtualFile);
string xsl = streamReader.ReadToEnd();
streamReader.Close();
xsl = xsl.Replace("{appRootUrl}", Helper.ApplicationRootUrl);
MemoryStream ms = new MemoryStream(System.Text.ASCIIEncoding.ASCII.GetBytes(xsl));
xslTransform.Load(new XmlTextReader(ms));
//- Load XML Data ---------------------------------------------------------------------
StringReader sr = new StringReader(inputXml);
XmlReader xr = new XmlTextReader(sr);
StringWriter sw = new StringWriter();
XmlWriter xw = new XmlTextWriter(sw);
//- Transform and Output Data ---------------------------------------------------------
xslTransform.Transform(xr, xw);
return sw.ToString();
}