Question: I was doing this first to return a particular set of nodes under the parent node that had id equal to 1 which worked fantastically.

```
IEnumerable<XElement> world1 = LevelData.root.
                               Elements("world").
                               Where(element => (int?)element.Attribute("id") == 1);

```

But i needed to do this multiple times and each to have there own instance so i thought to put them into a list but it doesn't even compile telling me error CS0266:

> 
> Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List>'. An explicit conversion exists (are you missing a cast?)
> 
> 
> 

```
List<IEnumerable<XElement>>[] World = new List<IEnumerable<XElement>>[noofworlds];

        foreach (List<IEnumerable<XElement>> wn in World)
        {
            Debug.WriteLine("World: "+w);

            //this will make a list of all the nodes (elements) within the world specified by the id tag
            World[w] =  LevelData.Root.Elements("world").Where(element => (int?)element.Attribute("id") == 1);//with id == to i
            w++;
        }

```

So I tried adding the cast `List<IEnumerable<XElement>>` just before `LevelData.root.` 
but then i get a invalidcastexception. I'm at a brick wall on where to go. Any advice?

Answer: 
The `Where` method doesn't return a `List<>`, it returns an `IEnumerable<>`, which is lazy-evaluated when it is enumerated. 

If you want an actual `List<>` object, stick a `.ToList()` at the end, and that will do it.
Your question is a bit confusing, you seem to have an array of `List<IEnumerable<XElement>>` and you are trying to assign a `IEnumerable<XElement>` to it.

If you just want a `List` of `IEnumerable<XElement>` this should work

```
List<IEnumerable<XElement>> World = new List<IEnumerable<XElement>>();
for (int i = 0; i < noofworlds; i++)
{
    World.Add(LevelData.Root.Elements("world").Where(element => (int?)element.Attribute("id") == i));//with id == to i
}

```

Otherwise tou are going to have to create a new list to add to the array and add the `IEnumerable<XElement>` to that list.

```
List<IEnumerable<XElement>>[] World = new List<IEnumerable<XElement>>[noofworlds];
for (int i = 0; i < noofworlds; i++)
{
    World[i] = new List<IEnumerable<XElement>> { (LevelData.Root.Elements("world").Where(element => (int?)element.Attribute("id") == i)) };//with id == to i
}

```