I'm trying to read this particular xml and I got an "System.Xml.Linq.XContainer.Element(...) returned null." error.

XML

```
  <P>
  <W>
    <WC>
      <A>1</A>
      <B>1</B>
      <C>1</C>
    </WC>
  </W>
  <Modules>
    <Module Attr="ex">
      <A>
        <B>2</B>
        <C>3</C>
        <D>4</D>
        <E>5</E>
        <F>6</G>
        <G>7</G>
      </A>
    </Module>
      <Module Attr="ex2">
      <A>
        <C>3</C>
        <D>4</D>
        <E>5</E>
      </A>
    </Module>
  </Modules>
  <Modules>
    <Module Attr="ex3">
      <A>
        <W>10</W>
        <V>9</V>
      </A>
    </Module>
    <Module Attr="XXXX">
      <A>
        <B>2</B>
        <C>3</C>
        <D>4</D>
        <E>5</E>
        <F>6</G>
        <G>7</G>
      </A>
    </Module>
   </Modules>
</P>

```

C#

```
XElement disXelement = XElement.Load($"PATH");

        var modules = from module in disXelement.Element("Modules").Elements("Module") 
                      where module.Attribute("Attr").Value == "XXXX"
                      select new
                      {
                          v = from s in module.Descendants()
                                select new
                                {
                                    Ip = v.Element("F").Value,
                                    Port = v.Element("G").Value
                                }
                      };

        foreach (var item in modules)
        {
            foreach (var i in item.v)
            {
                MessageBox.Show(i.Ip);
                MessageBox.Show(i.Port);
            }
        }

```

I would like to get the Value of F and G.

I Tried this : 

```
            var modules2 = disXelement.Element("Modules").Elements("Module")
                      .Where((module) => module.Attribute("Attr").Value == "XXXX")
                      .Select((module) => new
                      {
                          v= module.Descendants().Select((v) => new
                          {
                              Ip = (string)v.Elements().Where(e => e.Name.LocalName == "F").First(),
                              Port = (string)v.Elements().Where(e => e.Name.LocalName == "G").First()
                          })
                      });

```

Which work (got two messageBox the values but I receive an error :System.InvalidOperationException: 'Sequence contains no elements' at v = module.Descendants()...