XPath特定の XML ファイルで、Javaを使用して文字列の存在を検索しようとしています。ただし、文字列が存在する場合でも、私の出力は常にいいえとして表示されます。ここで誰かが私が間違っている可能性があることを指摘してくれることを願っていますか?
XML ファイル:
<article>
 <body>
  <section>
    <h1>intro1</h1>
    <region>introd1</region>
    <region>introd2</region>
  </section>
  <section>
    <h1 class="pass">1 task objectives</h1>
    <region>object1</region>
    <region>object2</region>
  </section>
  <section>
     <h1 class="pass">1 task objectives</h1>
     <region>object1</region>
     <region>This is the Perfect Word I am looking for</region>
  </section>
 </body>
</article>
Java内で、次のような単語の存在を確認しようとしてい"perfect"ます:
expr = xpath.compile("//article//body//section//region[contains(.,'perfect')]");
object result = expr.evaluate(doc,XPathConstants.NODESET);
NodeList nodes = (NodeList)result;
if (nodes.getLength() > 0) { 
    System.out.println("Found");
    // do other stuff here
} else {
    System.out.println("Not found");
}
これを実行すると、出力は常に"Not Found". 私が間違っていることは何ですか?