Writing the output of IEnumerable<XElement> to a XML File
- by Googler
HI folks ,
This is my code to read two xml files and merge their elemnts. I want to write the output to an xml file.
This is my code.
IEnumerable<XElement> list0 =
doc.Descendants(node1).Concat(doc2.Descendants(node2));
foreach (XElement el in list0)
Console.WriteLine(el);
Instead of writing to the console i need to write it to a xml file. Output is also in the xml format.How to achieve this. Can anyone pls give me a code or method to achiev this.