// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Xml; namespace E { public class MainClass { public static void Main(string[] args) { XmlDocument doc = new XmlDocument(); doc.AppendChild(doc.CreateElement("multiDay")); XmlDocument fil1 = new XmlDocument(); fil1.Load(@"C:\fil1.xml"); XmlDocument fil2 = new XmlDocument(); fil2.Load(@"C:\fil2.xml"); foreach(XmlElement elm in fil1.GetElementsByTagName("dag")) { doc.DocumentElement.AppendChild(doc.ImportNode(elm, true)); } foreach(XmlElement elm in fil2.GetElementsByTagName("dag")) { doc.DocumentElement.AppendChild(doc.ImportNode(elm, true)); } doc.Save(Console.Out); Console.ReadLine(); } } }