
1. Select the title of the book (use an absolute XPath expression)


    /Book/Title


2. Establish Book as the context node. Repeat (1) but this time
   use a relative XPath expression.


    Title


3. Select the Chapter titles (use an absolute XPath expression)


    /Book/Contents/Chapter/Title


4. Select all the title elements in the entire XML document


   //Title


5. What do you expect this XPath expression to do: //Title[1]
   Go ahead and execute it. Can you explain the result?


   //Title[1] means "For each node in the document, select the
                     first child Title element."


6. Select the Section within the Chapter with the id value "test."

   //Chapter[@id='test']/Section


7. Select all the Section elements that have a Subsection.

   //Section[Subsection]


8. Select all the Section elements that do NOT have a Subsection.

   //Section[not(Subsection)]


9. Is the value of the id attribute for Chapter 2 equal to 'test'?

   //Chapter[2]/@id = 'test'


10. What is the value of the id attribute for Chapter 2?

   //Chapter[2]/@id