I have the following document:
abc
ccc
ffffd
zz
First off, your example is not well-formed XML. Overlooking that and that you didn't describe your intents very well (What exactly do you want to select on which condition?), I assume you want to do this:
//cc[preceding-sibling::bb[text()="zz"]]/text()
It selects
TEXT VALUES OF ALL ELEMENTS
//cc /text()
THAT HAVE A PRECEDING SIBLING
[preceding-sibling::bb ]
THAT HAS TEXT VALUE EQUAL TO "zz"
[text()="zz"]
You could write is also as
//bb[text()="zz"]/following-sibling::cc/text()
Please look at the spec, it has some very well readable examples from which you'll learn a lot.