Q:

Parsing XML problem with LINQ 

I want to get some values from the XML file and insert them into a ListBox using LINQ. Where am I wrong?
<?xml version="1.0" encoding="UTF-8"?>
<tells> 
    <defindividual name="name1"/>
    <instanceof>
      <individual name="name1"/>
      <catom name="value"/>
    </instanceof>

    <defindividual name="name2"/>
    <instanceof>
      <individual name="name2"/>
      <catom name="value"/>
    </instanceof>

    <defindividual name="name3"/>
    <instanceof>
      <individual name="name3"/>
      <catom name="otherValue"/>
    </instanceof>
</tells> 

Code-behind:
protected void Button1_Click(object sender, EventArgs e)
{
    XDocument owlXML = XDocument.Load(Server.MapPath("App_Data\\myFile.xml"));

    var items = from item in owlXML.Descendants("instanceof")
                where item.Element("catom").Attribute("name").Value == "value"
                select new
                {
                    catom = item.Element("catom").Attribute("name").Value
                };

    foreach (var item in items) 
    {
        //ListBox1.DataSource = item;
        //ListBox1.DataBind();

        ListBox1.Items.Add(item.catom);
    }        
}

A:

var names = from item in owlXML.Descendants("instanceof")
            let name = item.Element("catom").Attribute("name")  // cache
            where name.Value == "value"
            select name;

foreach (var name in names.ToArray()) 
{
    ListBox1.Items.Add(name);
}

or
var items = from item in owlXML.Descendants("instanceof")
            let name = item.Element("catom").Attribute("name")  // cache
            where name.Value == "value"
            select new { catom = name }; // if ListBox is configured to field="catom"

ListBox1.DataSource = items.ToArray(); // items!
ListBox1.DataBind();

