XML
<Questions>
<Question>
<Id>1</Id>
<Text>aaa</Text>
</Question>
<Question>
<Id>2</Id>
<Text>bbb</Text>
</Question>
</Questions>
Code
question="aaa";
var doc = XDocument.Load(Server.MapPath(".") + "\\Questions.xml");
var elements = from element in doc.Descendants("Question")
let txt = element.Element("Text")
where question.CompareTo (txt)==0
select new
{
Id = element.Element("Id").Value,
};
This code elements.count()==>0
I would Like that select from xml where txt=='aaa'