Your problem is with the name() elements, which only find h1 and h2 tags.
In my experience, searching for chapter alone often returns false positives but try one of:
Code:
//*[re:test(., '^chapter ', 'i')]
//h:p[re:test(., '^chapter ', 'i')]
//*[re:test(., 'Chapter [1-9]')]
The "*" means search everything and often leads to multiple hits on the same chapter, if so try the "h<semicolon>p" version which limits the search to <p> elements (or something like that). The "^" means match the start of a line and [1-9] means a character between 1 and 9. Remove the ", 'i'" to not ignore case (exact match of the string elements).