protected boolean isMatchingElement(Object element, String pattern) {
    String str = getElementText(element);
    return str != null && compare(str, pattern);
  }
protected boolean isMatchingElement(Object element, String pattern)