HI,
assign Attribut from XmlElement in your bookname like in following code:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("Program39.xml");
XmlNodeList booknames = xmlDoc.GetElementsByTagName("book");
foreach (XmlElement item in booknames)
{
string name = item.GetAttribute("name");
Console.WriteLine(name);
}