title: Powershell how to determine if specific attribute exists in xml
body: <p>I been able in the past to do a similar task but i don't understand why it doesn't work for the this xml. I am using powershell to read iis settings for requestFiltering but when i am searching in the xml the node "fileExtensions" isn't considered a node. here is the xml.</p>
  
  <pre><code>&lt;system.webServer&gt;
    &lt;security&gt;
      &lt;requestFiltering&gt;
        &lt;fileExtensions allowUnlisted="true" applyToWebDAV="true"&gt;
  
          &lt;add fileExtension=".config" allowed="true" /&gt;        
        &lt;/fileExtensions&gt;
        &lt;requestLimits&gt;
          &lt;headerLimits&gt;
          &lt;/headerLimits&gt;
        &lt;/requestLimits&gt;
        &lt;verbs allowUnlisted="true" applyToWebDAV="true"&gt;
        &lt;/verbs&gt;
        &lt;hiddenSegments applyToWebDAV="true"&gt;
          &lt;add segment="web.config" /&gt;
  
        &lt;/hiddenSegments&gt;
        &lt;alwaysAllowedUrls&gt;
        &lt;/alwaysAllowedUrls&gt;
        &lt;alwaysAllowedQueryStrings&gt;
        &lt;/alwaysAllowedQueryStrings&gt;
        &lt;denyUrlSequences&gt;
        &lt;/denyUrlSequences&gt;
        &lt;denyQueryStringSequences&gt;
        &lt;/denyQueryStringSequences&gt;
        &lt;filteringRules&gt;
        &lt;/filteringRules&gt;
      &lt;/requestFiltering&gt;
    &lt;/security&gt;
  </code></pre>
  
  <p>$val = the above XML:</p>
  
  <pre><code>$xml = [xml]($val)
  $node = $xml.SelectSingleNode("//*[local-name() = 'fileExtensions']")
  </code></pre>
  
  <p>$node is null/ blank. How come? </p>