using System.Collections.Generic;
using System.Collections;
using System.Data.DataSetExtensions;
using System.Runtime.Remoting;
using System.Globalization;
using System.Runtime.CompilerServices;
public static void Main()
string input = @"<ENVELOPE>
<TALLYREQUEST>Import Data</TALLYREQUEST>
<REQUESTDESC><REPORTNAME>All Masters</REPORTNAME><STATICVARIABLES><SVCURRENTCOMPANY>MSIT</SVCURRENTCOMPANY></STATICVARIABLES></REQUESTDESC>
<Entry_x0020_NO.>125</Entry_x0020_NO.>
<NARRATION>1542</NARRATION>
<VOTURETYPENAME>456</VOTURETYPENAME>
XDocument doc = XDocument.Parse(input);
var messages = doc.Descendants("TALLYMESSAGE").Select(s=> new {
Entry = s.Element("Entry_x0020_NO.").Value,
DATE = s.Element("DATE").Value,
GUID = s.Element("GUID").Value,
NARRATION = s.Element("NARRATION").Value,
VOTURETYPENAME = s.Element("VOTURETYPENAME").Value,
AMOUNT = s.Element("AMOUNT").Value,
NAME = s.Element("NAME").Value,
foreach(var element in doc.Descendants("TALLYMESSAGE").Elements())
Console.WriteLine("{0} = {1}", element.Name, element.Value);
foreach(var messsage in messages)
Console.WriteLine(messsage);