title: XPath - Difference between node() and text()
body: <p>I'm having trouble understanding the difference between <code>text()</code> and <code>node()</code>. From what I understand, <code>text()</code> would be whatever is in between the tags <code>&lt;item&gt;apple&lt;/item&gt;</code> which is <strong>apple</strong> in this case. Node would be whatever that node actually is, which would be <strong>item</strong></p>
  
  <p>But then I've been assigned some work where it asks me to "Select the text of all items under produce" and a separate question asks "Select all the manager nodes in all departments" </p>
  
  <p>How is the output suppose to look <code>text()</code> as opposed to <code>node()</code></p>
  
  <p>Snippet of XML:</p>
  
  <pre><code>&lt;produce&gt;
   &lt;item&gt;apple&lt;/item&gt;
   &lt;item&gt;banana&lt;/item&gt;
   &lt;item&gt;pepper&lt;/item&gt;
  &lt;/produce&gt;
  
  &lt;department&gt;
   &lt;phone&gt;123-456-7891&lt;/phone&gt;
   &lt;manager&gt;John&lt;/manager&gt;
  &lt;/department&gt;
  </code></pre>
  
  <p>Of course, there are more departments and more managers, but this was just a snippet of code. </p>
  
  <p>Any help would be much appreciated!</p>