ElementInfo (@NotNull Element element) { boolean hasNullAttributes = false; StringBuilder buf = new StringBuilder(element.getName()); List<Attribute> attributes = getAttributes(element); int length = attributes.size(); if (length > 0) { buf.append("["); for (int idx = 0; idx < length; idx++) { Attribute attr = attributes.get(idx); if (idx != 0) { buf.append(";"); } buf.append(attr.getName()); buf.append("="); buf.append(attr.getValue()); if (attr.getValue() == null) { hasNullAttributes = true; } } buf.append("]"); } return new ElementInfo(buf, hasNullAttributes); }