title: C# clear XML innertext but not nodes
body: <p>I have XML that looks like below.  How can I clear all the text within the nodes without deleting any of the nodes?  I want to go from my starting XML to my ending XML.  </p>
  
  <p>My issue is that when I do the following it clears out the nodes as well and I end up with just node1 with no children nodes:</p>
  
  <pre><code>lst = doc.selectNodes("node1");
   foreach (XmlNode node in lst)
              {
                  node.InnerText = "";
              }
  </code></pre>
  
  <p>Starting XML:</p>
  
  <pre><code>&lt;node1&gt;
    &lt;node2&gt;
      &lt;node4&gt;99999&lt;/node4&gt;
    &lt;/node2&gt;
    &lt;node3&gt;abdg&lt;/node3&gt;
  &lt;/node1&gt;
  </code></pre>
  
  <p>Desired ending XML:</p>
  
  <pre><code>&lt;node1&gt;
    &lt;node2&gt;
      &lt;node4&gt;&lt;/node4&gt;
    &lt;/node2&gt;
    &lt;node3&gt;&lt;/node3&gt;
  &lt;/node1&gt;
  </code></pre>