public static boolean areElementsEqual(@Nullable Element e1, @Nullable Element e2, boolean ignoreEmptyAttrValues) {
    if (e1 == null && e2 == null) return true;
    if (e1 == null || e2 == null) return false;

    return Objects.equals(e1.getName(), e2.getName())
           && isAttributesEqual(getAttributes(e1), getAttributes(e2), ignoreEmptyAttrValues)
           && areElementContentsEqual(e1, e2, ignoreEmptyAttrValues);
  }
public static boolean areElementsEqual(@Nullable Element e1, @Nullable Element e2, boolean ignoreEmptyAttrValues)