Transforming XSLT with C#

Created 14 October 2005 00:00
  XPathDocument xmlDoc = new XPathDocument(Server.MapPath("/Menu.xml"));
  XslTransform xslt = new XslTransform();
  xslt.Load(Server.MapPath("/Menu.xslt"));
  
  Stream str = new MemoryStream();
  XsltArgumentList arguments = new XsltArgumentList();
  xslt.Transform(xmlDoc, arguments, str, null);
  str.Flush();
  str.Position = 0;
  
  using (StreamReader sr = new StreamReader(str))
  {
      string html = sr.ReadToEnd();
      sr.Close();
      return html;
  }