title: Powershell: search for multiple string multiple xml and output results to csv
body: <p>I need help to search for multiple xml files for multiple string's and then output the results into a csv or txt file. The xml files are all in the same format. </p>
  
  <p>At the moment I can only extract single string from single xml using the following:</p>
  
  <pre><code>$xml = [xml](Get-Content 'C:\App\test.xml')
  $xml.application.stage1.c_firstname
  </code></pre>
  
  <p>Which returns the name, I need to be able to return <code>c_surname</code> and <code>c_userid</code> and output that to a csv file(ideally or text) on multiple xml   </p>
  
  <p>Sample XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;application&gt;
    &lt;stage1&gt;
      &lt;c_product_name&gt;Test&lt;/c_product_name&gt;
      &lt;c_firstname&gt;Bill&lt;/c_firstname&gt;
      &lt;c_surname&gt;Gates&lt;/c_surname&gt;
    &lt;/stage1&gt;
    &lt;stage5&gt;
      &lt;c_number&gt;12345TEST&lt;/c_number&gt;
    &lt;/stage5&gt;
  &lt;/application&gt;
  </code></pre>