title: Confused about XML DOM root node
body: <p>According to the following resource:</p>
  
  <pre><code>http://www.w3schools.com/xml/dom_nodetype.asp
  </code></pre>
  
  <p>the node type of DOCUMENT_NODE have the nodeName as "#document" and nodeValue as null. it can have the following node types as its children:</p>
  
  <pre><code>Element (max. one), ProcessingInstruction, Comment, DocumentType
  </code></pre>
  
  <p>this gave me a impression that the DOCUMENT_NODE (so-called root node) should be the invisible node above the first visible element node of the document.</p>
  
  <p>But it turned out, given the XML document:</p>
  
  <pre><code>&lt;bookstore&gt;
      &lt;book category="cooking"&gt;
          &lt;title lang="en"&gt;Everyday Italian&lt;/title&gt;
          &lt;author&gt;Giada De Laurentiis&lt;/author&gt;
          &lt;year&gt;2005&lt;/year&gt;
          &lt;price&gt;30.00&lt;/price&gt;
      &lt;/book&gt;
  &lt;/bookstore&gt;
  </code></pre>
  
  <p>xmlDoc.documentElement.nodeName returned "bookstore" instead of "#document". Contrary to what was described in the w3schools resource, the "bookstore" element may have more than one "book" elements and it seems inappropriate for the "bookstore" element to have DocumentType node as its child node.</p>
  
  <p>Would anyone please offer some clarification to my confusion?</p>