ok i understand now. In fact i am looking for results which have this condition of qcode=tx . I do not want to know if it's true or false.
Perfect, so use the predicate, as suggested by Max
$d// item[@qcode="tx"]
For more details, please spend some time on an XPath/XQuery primer, such as http://www.w3schools.com/xsl/xpath_intro.asp.