У меня есть xml-файл как под
<!--Sample Person Data-->
<Person>
<PersonDetail PersonId="1">
<Name>Priyanka Das</Name>
<Age>30</Age>
<Sex>Male</Sex>
<LivesIn>Bangalore</LivesIn>
<Email>nb@training.com</Email>
</PersonDetail>
<PersonDetail PersonId="2">
<Name>Shashidhar Nikatani</Name>
<Age>40</Age>
<Sex>Male</Sex>
<LivesIn>Bangalore</LivesIn>
<Email>sn@training.com</Email>
</PersonDetail>
<PersonDetail PersonId="3">
<Name>Arundhuti Roy</Name>
<Age>27</Age>
<Sex>Female</Sex>
<LivesIn>Kerala</LivesIn>
<Email>ab@training.com</Email>
</PersonDetail>
<PersonDetail PersonId="4">
<Name>Nitin Mallik</Name>
<Age>28</Age>
<Sex>Male</Sex>
<LivesIn>Bangalore</LivesIn>
<Email>ng@training.com</Email>
</PersonDetail>
<PersonDetail PersonId="5">
<Name>Essaki Raja Kandaswamy</Name>
<Age>27</Age>
<Sex>Male</Sex>
<LivesIn>Madras</LivesIn>
<Email>er@training.com</Email>
</PersonDetail>
</Person>
Мне нужно узнать подробности о людях, которые живут в Бангалоре.
Я сделал ниже, но не смог получить никакого результата
XDocument xmlSource = null;
xmlSource = XDocument.Load(@"D:\Personsample.xml");
var query = from data in xmlSource.Descendants("Person")
where (string)data.Element("LivesIn") == "Bangalore"
select data;
Требуется помощь