This is an extract of the XML i'm using

```
    <AccountNumber>
      <RecordID>A9</RecordID>
      <SegmentLength>14</SegmentLength>
      <Number>6770307103</Number>
    </AccountNumber>
    <PaymentCounter>
      <RecordID>B2</RecordID>
      <SegmentLength>14</SegmentLength>
      <History>99</History>
      <Delinq30Day>00</Delinq30Day>
      <Delinq60Day>00</Delinq60Day>
      <Delinq90PlusDay>00</Delinq90PlusDay>
      <DerogCnt>00</DerogCnt>
    </PaymentCounter>

```

Here I'm trying to identify the number of child elements under AccountNumber and PaymentCounter. 

I'm looking for this answer
AccountNumber count = 3
PaymentCounter count = 7

After I get the count, I will use the data to dynamically populate a table. 

I tried this : 
int count1 = xmlDocument.Descendants("AccountNumber").Count();

The count() in LINQ to XML will give me the number of times element "AccountNumber" is repeated in the XML, but doesnot give me the number of child elements. 

Is there a way to do this?