docs: @SuppressWarnings("checkstyle:cyclomaticcomplexity")
  	public static void writeAttributeContainer(Element element, AttributeProvider container, XMLBuilder builder,
  			XMLResources resources, boolean writeStandardAttribute) {
  		final Element attrsNode = builder.createElement(NODE_ATTRIBUTES);
  		for (final Attribute attr : container.attributes()) {
  			final AttributeType attrType = attr.getType();
  			if (attr.isAssigned()) {
  				try {
  					final String name = attr.getName();
  					if (writeStandardAttribute
  						|| (!XMLUtil.ATTR_ID.equalsIgnoreCase(name)
  								&& !XMLUtil.ATTR_NAME.equalsIgnoreCase(name)
  								&& !XMLUtil.ATTR_COLOR.equalsIgnoreCase(name)
  								&& !ATTR_GEOID.equalsIgnoreCase(name))) {
  						final Element attrNode;
  						switch (attrType) {
  						case DATE:
  							attrNode = builder.createElement(NODE_ATTRIBUTE);
  							attrNode.setAttribute(XMLUtil.ATTR_NAME, attr.getName());
  							attrNode.setAttribute(ATTR_TYPE, attrType.name());
  							attrNode.setAttribute(ATTR_VALUE, XMLUtil.toString(attr.getDate()));
  							break;
  						case URL:
  							attrNode = builder.createElement(NODE_ATTRIBUTE);
  							attrNode.setAttribute(XMLUtil.ATTR_NAME, attr.getName());
  							attrNode.setAttribute(ATTR_TYPE, attrType.name());
  							attrNode.setAttribute(ATTR_VALUE, resources.add(attr.getURL()));
  							break;
  							//$CASES-OMITTED$
  						default:
  							final String value = attr.getString();
  							if (value != null && !"".equals(value)) { //$NON-NLS-1$
  								attrNode = builder.createElement(NODE_ATTRIBUTE);
  								attrNode.setAttribute(XMLUtil.ATTR_NAME, attr.getName());
  								attrNode.setAttribute(ATTR_VALUE, value);
  								attrNode.setAttribute(ATTR_TYPE, attrType.name());
  								attrsNode.appendChild(attrNode);
  							}
  						}
  					}
  				} catch (AssertionError e) {
  					throw e;
  				} catch (Throwable exception) {
  					//
  				}
  			}
  		}
  		if (attrsNode.getChildNodes().getLength() > 0) {
  			element.appendChild(attrsNode);
  		}
  	}