I don't really understand your structure - what is the significance of the "item" elements?
It's probably a good idea to think of this (and perhaps to implement it) as two stages of transformation. The first is quite easy, and produces an output like:
<title>first title</title>
<title>second title</title>
<text>some text</text>
<title>third title</title>
The next stage is to group a title with its following text element. This is easy in XSLT 2.0, which has a special instruction
<xsl:for-each-group select="*" group-starting-with="title">
It's much harder in XSLT 1.0, and isn't a task that I would recommend beginners to tackle. The task is called "positional grouping" and usual solution is "sibling recursion" which involves recursive processing of the sequence of siblings; you will find information by googling either of these terms.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference