title: How to get a specific node text using php DOM
body: <p>I am trying to get the value (text) of a specific node from an xml document using php DOM classes but I cannot do it right because I get the text content of that node merged with its descendants.</p>
  
  <p>Let's suppose that I need to get the <em>trees</em> from this document:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;trees&gt;
    LarchRedwoodChestnutBirch
    &lt;trimmed&gt;Larch&lt;/trimmed&gt;
    &lt;trimmed&gt;Redwood&lt;/trimmed&gt;
  &lt;/trees&gt;
  </code></pre>
  
  <p>And I get:</p>
  
  <pre><code>LarchRedwoodChestnutBirchLarchRedwood
  </code></pre>
  
  <p>You can see that I cannot remove the substring <em>LarchRedwood</em> made by the <em>trimmed</em> trees from the whole text because I would get only <em>ChestnutBirch</em> and it is not what I need.</p>
  
  <p>Any suggest? (Thanx)</p>