code: public static void assertXpathExists(String xPathExpression, 
                                           Document inDocument)
          throws XpathException {
          XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
          NodeList nodeList = simpleXpathEngine.getMatchingNodes(
                                                                 xPathExpression, inDocument);
          int matches = nodeList.getLength();
          assertTrue("Expecting to find matches for Xpath " + 
                     xPathExpression, matches > 0);
      }
docs: Assert that a specific XPath exists in some given XML
  @param xPathExpression
  @param inDocument
  @see XpathEngine which provides the underlying evaluation mechanism