title: Read an XML node in namespace using Linq
body: <p>How do I work out what the namespace declaration is for the Extension node?</p>
  
  <p>I want to return all of the child nodes under: GPO->User->ExtensionData->Extension</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;GPO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.microsoft.com/GroupPolicy/Settings"&gt;
    &lt;User&gt;
      &lt;VersionDirectory&gt;4&lt;/VersionDirectory&gt;
      &lt;VersionSysvol&gt;4&lt;/VersionSysvol&gt;
      &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;ExtensionData&gt;
        &lt;Extension xmlns:q1="http://www.microsoft.com/GroupPolicy/Settings/Scripts" xsi:type="q1:Scripts"&gt;
          &lt;q1:Script&gt;
            &lt;q1:Command&gt;Logon.cmd&lt;/q1:Command&gt;
            &lt;q1:Type&gt;Logon&lt;/q1:Type&gt;
            &lt;q1:Order&gt;0&lt;/q1:Order&gt;
            &lt;q1:RunOrder&gt;PSNotConfigured&lt;/q1:RunOrder&gt;
          &lt;/q1:Script&gt;
        &lt;/Extension&gt;
        &lt;Name&gt;Scripts&lt;/Name&gt;
      &lt;/ExtensionData&gt;
    &lt;/User&gt;
    &lt;LinksTo&gt;
      &lt;SOMName&gt;an interesting data value&lt;/SOMName&gt;
      &lt;SOMPath&gt;some data value&lt;/SOMPath&gt;
      &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;NoOverride&gt;false&lt;/NoOverride&gt;
    &lt;/LinksTo&gt;
  &lt;/GPO&gt;
  </code></pre>
  
  <p>This is my attempt:</p>
  
  <pre><code>Dim NS As XNamespace = "http://www.microsoft.com/GroupPolicy/Settings/Scripts"
  Dim UserPolCount = XDoc.Descendants(NS + "Extension").First()
  </code></pre>
  
  <p>I get the following error: Sequence contains no elements</p>
  
  <p>Also, the XML sample I have provided is only a small snippet, the ExtensionData->Extension nodes can be nested in different areas, so I was hoping to find the way of specifying the full path.</p>
  
  <p>Thanks</p>