Parse XML File with PowerShell and if a value is found, copy file to a new location : <p>I have an application that outputs XML files during the life of an event in the software.  I need to parse the XML files and once certain text are matched, move the file to another folder</p>

<p>The file name format of each XML file is: Event Owner (MEMS), Year (2020) and serial number (00012345).  The software will write same file multiple time throughout the event so I need to look for specific items before taking any action.
I would prefer to do this in PowerShell if at all possible.</p>

<p>I need to find</p>

<pre><code> `&lt;EventUnits&gt;
      &lt;Unit&gt;
        &lt;UnitCode&gt;xxxxxxx&gt;&lt;/UnitCode&gt;
&lt;/EventUnits&gt;`
</code></pre>

<p>and </p>

<pre><code>&lt;EventDetails&gt;
        &lt;EventCompletedTime&gt;YYYY-MM-DD HH:MM:SS&lt;/EventCompletedTime&gt;
&lt;/EventDetails&gt;
</code></pre>

<p>Once UnitCode equals one of 4 unit codes and EventCompleted has a valid date and time, the file is moved to a different folder.</p>
