public class Predicate { Array of XPathResults ResultSet; Predicate(Array of XPathResults ResultSet, DOM_Document XML_DOM) { Check if this predicate is just a logical condition or a complete XPath query. If it is a complete XPath expression { ResultSet = (new XPathExpression(XML_DOM, XPath Expression)) .getResult(); }//If it is a complete XPath expression else { ResultSet = Filtered result set; }//else }//constructor Array of XPathResults getResult() { return ResultSet; }//getResult }//class