afshandc you reposted
namespace ReadXMLfromFile
{
class Class1
{
static void Main(string[] args)
{
string onlyContent = string.Empty;
XmlDocument xdoc = new XmlDocument();
xdoc.Load(@"C:\Users\afshandc\Desktop\ConsoleApplication1\ConsoleApplication1\Visitors (2).xml");
var visitors = xdoc.SelectNodes("Visitors/Visitor");
for (int i = 0; i < visitors.Count; i++)
{
onlyContent += string.Format("\n", i);
foreach (XmlNode node in visitors[i].ChildNodes)
onlyContent += string.Format("{0},", node.InnerText);
}
File.WriteAllText(@"C:\Users\afshandc\Desktop\ConsoleApplication1\ConsoleApplication1\Written XML.txt", onlyContent);
}
}
}