title: How do I test whether a certain XML node exists?
body: <p>What is the proper way to test for the existance of an optional node?  A snipped of my XML is:</p>
  
  <pre><code>&lt;Antenna &gt;
    &lt;Mount Model="text" Manufacture="text"&gt;
     &lt;BirdBathMount/&gt;
    &lt;/Mount&gt;
  &lt;/Antenna&gt;
  </code></pre>
  
  <p>But it could also be:</p>
  
  <pre><code>&lt;Antenna &gt;
    &lt;Mount Model="text" Manufacture="text"&gt;
     &lt;AzEl/&gt;
    &lt;/Mount&gt;
  &lt;/Antenna&gt;
  </code></pre>
  
  <p>The child of Antenna could either be BirdBath or AzEl but not both...</p>
  
  <p>In Delphi XE I have tried:</p>
  
  <pre><code> if (MountNode.ChildNodes.Nodes['AzEl'] &lt;&gt; unassigned then //Does not work
   if (MountNode.ChildNodes['BirdBathMount'].NodeValue &lt;&gt; null) then // Does not work
   if (MountNode.BirdBathMount.NodeValue &lt;&gt; null) then  // Does not work
  </code></pre>
  
  <p>I use XMLSpy to create the schema and the example XML and they parse correctly.  I use Delphi XE to create the bindings and it works on most other combinations fine.</p>
  
  <p>This <em>must</em> have a simple answer that I have just overlooked - but what?
  Thanks...... Jim</p>