title: Replace >, <, & chars that appear inside XML nodes
body: <p><a href="https://stackoverflow.com/questions/2282614/regular-expression-to-match-chars-that-appear-inside-xml-nodes">Regular expression to match &quot;&gt;&quot;, &quot;&lt;&quot;, &quot;&amp;&quot; chars that appear inside XML nodes</a></p>
  
  <p>I have an almost indentical problem to this - however, I am using C#. </p>
  
  <p>I'm not here to argue the validity of the XML.</p>
  
  <p>What gets sent in is out of my control.</p>
  
  <p><strong>Input XML:</strong></p>
  
  <pre><code>&lt;PNODE&gt; 
    &lt;CNODE&gt;This string contains &gt; and &lt; and &amp; chars.&lt;/cnode&gt; 
  &lt;/PNODE&gt; 
  </code></pre>
  
  <p><strong>I need it to look like this:</strong></p>
  
  <pre><code>&lt;PNODE&gt; 
    &lt;CNODE&gt;This string contains &amp;gt; and &amp;lt and &amp;amp; chars.&lt;/CNODE&gt; 
  &lt;/PNODE&gt; 
  </code></pre>
  
  <p>It looks like the guy found a solution for PHP- which doesn't help me.</p>
  
  <p>However, I need to find a way escape the &amp;, > and &lt; characters inside the node, but leave the tag declarations alone.</p>