Thank you kovidgoyal.
I final got it to work. I'm not sure why it did not work before, maybe it had something to do with the chapter threshold, or the fact I kept using toc1 as the name of my class thought out my many tries. Or a wrong xpath. Anyway it work now (at less for now, anyway) here is the code I got it to work with, thanks to kovidgoyal. Hopeful others can use this to solve the same problem.
Code:
<div style="display:none">
<p class="toca">Chapter test</p></div>
and the xpath
Code:
//h:div/h:p[re:test(@class, "toca", "i")]
Isn't learning fun! I like learning new things. And sometimes I will not give up till I solve my problem.