How to check if XElement has any child nodes?
<p>I have the following condition,</p>

<pre><code>if (myXElement.FirstNode.NodeType == XmlNodeType.CDATA)
</code></pre>

<p>This throws an exception if there is no <code>FirstNode</code> in <code>myXElement</code>, so I have to check first if there is any. </p>

<p>Note that I need to check for nodes not elements.</p>