In XPath 2.0,
match1/following-sibling::* intersect match2/preceding-sibling::*
There's no intersect operator in XPath 1.0, but you can express
$a intersect $b
as
$a[count(.|$b) = count($b)]
However in XSLT 1.0 this kind of problem is often best tackled with a recursive template that processes the elements from match1 one by one until match2 is reached. For examples, google for "XSLT positional grouping" or "XSLT sibling recursion".
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference