Forgive my rusty XSLT, but in your first for-each loop, I believe you could do something like:
<xsl:if test="count(following-sibling::titlePara) > 0">
<xsl:variable name="offset" select="position() + following-sibling::titlePara/position()"/>
Then maybe something like:
<xsl:if test="position() < $offset">
Inside the very first for-each.
This is all of the top of my head, and probably I made some errors, but it might be a start.