Suppose I have the following XML:
Purgatorio
Dante Alighieri<
Try
//book[title/@lang = 'it']
This reads:
book
elements
title
lang
"it"
You may find this helpful — it's an article entitled "XPath in Five Paragraphs" by Ronald Bourret.
But in all honesty, //book[title[@lang='it']]
and the above should be equivalent, unless your XPath engine has "issues." So it could be something in the code or sample XML that you're not showing us -- for example, your sample is an XML fragment. Could it be that the root element has a namespace, and you aren't counting for that in your query? And you only told us that it didn't work, but you didn't tell us what results you did get.