I am working on a text summarization method ,for test my method i have a benchmark called doc 2007 ,inside this benchmark i have a lot of xml file ,i should cle
Using LINQ to XML should be easier:
var res = XElement.Parse(xml)
.Descendants("sentence").Where(e => e.Attribute("id").Value == "s0")
.FirstOrDefault().Value;
or, as Yeldar suggested, the cleaner way would be:
var s0 = XElement.Parse(xml)
.Descendants("sentence").FirstOrDefault(e => e.Attribute("id").Value == "s0")
.Value;