title: PowerShell: Retrieve a specific internal XML element
body: <p>I have an XML document with this structure:</p>
  
  <pre><code>&lt;Fruits&gt;
      &lt;Fruit&gt;
          &lt;Code&gt;1&lt;/Code&gt;
          &lt;Name&gt;Apple&lt;/Name&gt;
      &lt;/Fruit&gt;
  &lt;/Fruits&gt;
  </code></pre>
  
  <p>What is the best way to get a <code>&lt;Fruit&gt;</code> element by its code (or any other field) in PowerShell 1 code?
  (Not XPath, as it is supported in PowerShell 2 only)</p>
  
  <p>Thanks!</p>