title: How to get only the content of a XmlNode in c#
body: <p>I am trying to parse a XML file to get the content of each node (if it's not empty). However I got a problem, I got two times the same value :</p>
  
  <p>To let you understand here is my XML part:</p>
  
  <pre><code>&lt;para&gt;
     &lt;emphasis role="bold"&gt;foobar&lt;/emphasis&gt;
  &lt;/para&gt;
  </code></pre>
  
  <p>When I get the innerText of <code>&lt;para&gt;</code> it gives me "foobar" and when I get the content of <code>&lt;emphasis&gt;</code> it gives me foobar too.</p>
  
  <p>I am using C# in this way</p>
  
  <pre><code>//[foreach loop ...]
      if (node.Name == "para" || node.Name == "emphasis" )
      {
          if (!String.IsNullOrWhiteSpace(subNode.InnerText)) 
          {
            Debug.WriteLine(node.Name+ " - " + node.InnerText);
          }
  
      }
  </code></pre>
  
  <p>How to get only the content of the node asked and not all the text located in its subnodes.</p>
  
  <p>Thanks</p>