have tried to parse an XML file like this:

<books>
<book>
<attr name="Moby Dick">Moby Dick is a classic</attr>
<attr isbn="isbnNumber">123456789</attr>
</book>
</books>

How can I get the value of "123456789"? I don't really need the first attribute.

I tried reading these in a foreach loop getting XElements but I keep getting a NULL object exception.

foreach(XElement xe in XDoc.Attribute("attr"))
{
string str = xe.Attribute("isbnNumber").Value // NULL EXCEPTION HERE
}

Thanks in advance...