// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.IO; using System.Xml; using System.Xml.Xsl; class MainClass { public static void Main(string[] args) { XmlDocument doc = new XmlDocument(); doc.Load(@"C:\test.xml"); XslCompiledTransform xslt = new XslCompiledTransform(); xslt.Load(@"C:\test.xsl"); XmlTextWriter wrt = new XmlTextWriter(new StreamWriter(@"C:\test4.xml")); wrt.Formatting = Formatting.Indented; xslt.Transform(doc, wrt); } }