You can alway test for null on a XElement.
var result = from book in books.Elements("book")
where book.Attribute("id") != null && book.Attribute("name") != null
select new { Name = book.Attribute("name").Value, ISBN = book.Attribute("isbn") == null ? "Missing" : book.Attribute("isbn").Value };
If attribute "isbn" is missing, the string "Missing" is used.