The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

xpointer(//chapter[position() = 2]/range-to(following::chapter[1]))
xpointer(//chapter[position() <= 2]/range-to(following::chapter[1]))
xpointer(//chapter[position() = last()]/range-to(following::chapter[1]))
xpointer(//chapter[position() = 3]/range-to(/.//chapter[position() = 1]))