I know this is probably a lot easier than I'm making it. I'm able to pull all the machines out of the XElement but I'm trying to figure out how to pull out the machines with a specific sequence number. In the below XML snippet, I'd like to use the machines where sequence = 1.
XML:
<Location>
<Sequence>1</Sequence>
<Machines>
<Machine></Machine>
<Machine></Machine>
</Machines>
</Location>
<Location>
<Sequence>2</Sequence>
<Machines>
<Machine></Machine>
<Machine></Machine>
</Machines>
</Location>
Code:
IEnumerable<XElement> locSeqMachines =
from seq in LocationRows.Descendants("Location")
select seq;
var eMachines = locSeqMachines.Descendants("Machine");
foreach (var machine in eMachines)
{
}