
1. How many Title elements are in this document? (Create an XPath expression
   that answers this question)

    count(//Title)


2. Book has an id attribute. What is the length of the value of id? (Create an XPath expression
   that answers this question)

    string-length(/Book/@id)


3. Select all the Titles that do not contain the # symbol.


    //Title[not(contains(., '#'))]


4. Fetch the ISBN value of the Book. I only want the actual
   ISBN, not 'isbn-', i.e., you need to strip off the 'isbn-' prefix.

   substring(/Book/@id, 6)


5. What's the name of the first child element of the Chapter element with id="test"? (Create an XPath expression
   that answers this question)


   name(//Chapter[@id='test']/child::*[1])


6. Encode this string: 'Attack the Enemy'. Use whatever encoding scheme you want.


   translate('Attack the Enemy', 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'Zabcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXY')


7. Write an XPath expression that divides 22 by 7.


   22 div 7


8. Select every other Title. Hint: there is an XPath function called position() that
   returns an integer. That integer represents the position of the element within
   the sequence of elements that were selected.


   /descendant::Title[position() mod 2 = 0]


9. Write an XPath expression that substracts 2 from 4.


   4 - 2


10. Write an XPath expression that adds 60 to Date


   /Book/Date + 60