This is my XML structure, which is a list of events that each contains a list of event times. I need to return a list of ‘TIME’ values, but im stuck on how to get these values (Note that I need to query this list & filter by ‘Id’)

Code so far:
public IEnumerable<EventFeed> GetEventDatesByEventId(int eventId)
{
return (from feed in xmlDoc.Descendants("Event")
where (int)feed.Element("Id") == eventId
from ev in feed.Elements("Times")
select new EventFeed()
{
EventDate = (DateTime)ev.Element("Time")
}).ToList().OrderByDescending(x => x.EventDate);
}
thanks
kb
Close, you’ll need to select the
<Times>node first or useDescendantssince<Time>is belowEventTime:Sample:
Outputs: