title: Why doesn't IXMLNode.IsTextElement return True for CDATA elements?
body: <p>We're using Delphi 2007 and the <code>oxmldom</code> <code>Open XML</code> provider.</p>
  
  <p>A normal situations input file looks similar to this:</p>
  
  <pre><code>&lt;root&gt;
    &lt;child&gt;Some Text&lt;/child&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Now we have to process an input file that uses the <code>CDATA</code> node type:</p>
  
  <pre><code>&lt;root&gt;
    &lt;child&gt;&lt;![CDATA[Some special Text]]&gt;&lt;/child&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p><code>Node.IsTextElement</code> suddenly returns <code>False</code>, but <code>Node.Text</code> still works as expected.</p>
  
  <p>I know that <code>IXMLNode.IsTextElement</code> is just a convenience method, but I find this behavior rather odd.</p>
  
  <p>As a workaround we're now using this custom method:</p>
  
  <pre><code>class function TXmlUtils.IsTextOrCDataElement(ANode: IXMLNode): Boolean;
  begin
    Result := False;
    if ANode.ChildNodes.Count = 0 then begin
      if ANode.NodeType in [ntText, ntCData] then begin
        Result := True;
      end;
    end else
    if ANode.ChildNodes.Count = 1 then begin
      if ANode.ChildNodes.First.NodeType in [ntText, ntCData] then begin
        Result := True;
      end;
    end;
  end;
  </code></pre>
  
  <p>My question is: Why does <code>IsTextElement</code> not work with <code>CDATA</code> nodes and is there an easier workaround?</p>