title: How to select an XmlElement based on an attribute value?
body: <p>Say I have the following xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;catalog&gt;
     &lt;book id="bk101"&gt;
        &lt;author&gt;Gambardella, Matthew&lt;/author&gt;      
     &lt;/book&gt;
     &lt;book id="bk102"&gt;
        &lt;author&gt;Ralls, Kim&lt;/author&gt;
     &lt;/book&gt;
     &lt;book id="bk103"&gt;
        &lt;author&gt;Corets, Eva&lt;/author&gt;     
     &lt;/book&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>I have an xmlNode representing the whole file which I read in from a file by doing</p>
  
  <pre><code>$myXml=New-Object XML
  $myXml.Load("path to the books file")
  </code></pre>
  
  <p>How do I then select the book element  which has the id value of "bk102" so I can then pass that Xmlnode off to another function expecting an XMlNode?</p>
  
  <p>i.e my new node would be :</p>
  
  <pre><code>$Node = &lt;book id="bk102"&gt;
         &lt;author&gt;Ralls, Kim&lt;/author&gt;
      &lt;/book&gt;
  </code></pre>
  
  <p>Thanks all.  Been struggling all morning.</p>