XPath tree view of demo.xml

root
   |
   | ___ processing instruction  target= xml-stylesheet  instruction= href="test1.xsl" type="text/xsl"
   |
   | ___ comment    first comment 
   |
   | ___ element   main
   |         |
   |         | ___ processing instruction  target= second-PI  instruction= in document
   |         |
   |         | ___ element   a
   |                 |
   |                 | ___ text    first text chunk inside first a  \n       
   |                 |
   |                 | ___ comment    second comment inside a 
   |                 |
   |                 | ___ text   \n       second text chunk inside first a  \n       
   |                 |
   |                 | ___ comment    third comment inside a 
   |                 |
   |                 | ___ processing instruction  target= third-PI  instruction= in document
   |                 |
   |                 | ___ element   b
   |                 |         |    \___ attribute   link = /main/a/b/@link
   |                 |         |
   |                 |         | ___ text    b inside a 
   |                 |
   |                 | ___ processing instruction  target= fourth-PI  instruction= in document
   |
   | ___ comment    last comment