boolean (Content c1, Content c2, boolean ignoreEmptyAttrValues) { if (!(c1 instanceof Element) && !(c2 instanceof Element)) { return c1.getValue().equals(c2.getValue()); } return c1 instanceof Element && c2 instanceof Element && areElementsEqual((Element)c1, (Element)c2, ignoreEmptyAttrValues); }