Select correct and incorrect XML nodes in two separate files
<p>Ok, I have to do the following IN C# ( C Sharp ), I am new to C Sharp programming.</p>

<p>I have got  the following ( see below )XML file. It is required from me to select using XPath all coreect nodes in a separate .txt file, and all incorrect nodes as well in a separate .txt file.</p>

<p>The correct nodes need to satisfy the following conditions in XPath:</p>

<pre>
ResourceCatalog/ Resource
ResourceCatalog / ResourceGroup / Resource
ResourceCatalog ........... ResourceGroup / Resource
</pre>

<p>This is the original XML file:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;ResourceCatalog&gt;
  &lt;Resource name ="Res1"&gt;&lt;/Resource&gt;
  &lt;Resource&gt;
    &lt;Name&gt;Res3&lt;/Name&gt;
  &lt;/Resource&gt;
  &lt;Service&gt;
    &lt;Resource name ="Res2"&gt;&lt;/Resource&gt;
    &lt;ResourceGroup name="Group2"&gt;
      &lt;Resource name ="Res4"&gt;&lt;/Resource&gt;
      &lt;Resource&gt;
        &lt;Name&gt;Res6&lt;/Name&gt;
      &lt;/Resource&gt;
    &lt;/ResourceGroup&gt;
  &lt;/Service&gt;
  &lt;ResourceGroup name="Group1"&gt;
    &lt;ResourceGroup name="Group12"&gt;
      &lt;Service&gt;
        &lt;Resource name ="Res8"&gt;&lt;/Resource&gt;
      &lt;/Service&gt;
      &lt;Resource name ="Res5"&gt;&lt;/Resource&gt;
      &lt;Resource&gt;
        &lt;Name&gt;Res7&lt;/Name&gt;
      &lt;/Resource&gt;
    &lt;/ResourceGroup&gt;
    &lt;Resource name ="Res9"&gt;&lt;/Resource&gt;
  &lt;/ResourceGroup&gt; 
&lt;/ResourceCatalog&gt;
</code></pre>
