title: How To Figure Out if an HTML Block Does Not Contain Any Text Nodes
body: <p>How do you/is there a way to figure out if a block of HTML contains zero text nodes?</p>
  
  <p>e.g. this:</p>
  
  <pre><code>&lt;p&gt;&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;
  </code></pre>
  
  <p>contains zero text nodes whereas this:</p>
  
  <pre><code>&lt;p&gt;Stuff&lt;/p&gt;&lt;div&gt;&lt;span&gt;other stuff&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  
  <p>contains two. </p>
  
  <p>Additionally, you're guaranteed that the HTML is XHTML-compliant and the content is probably less than 4k in size. I'm using .net, so if some kind of server-side suggestion is made, please make it in C#. I suppose I could load the thing into an XmlDocument and traverse the DOM tree looking for non-empty XmlText nodes, but that would be a last resort as speed is of paramount concern.</p>