if (attributeList.getNamedItem(propertyName) != null && value != null) {
Node attributeNode = attributeList.getNamedItem(propertyName);
attributeNode.setTextContent(value);
} else if (attributeList.getNamedItem(propertyName) != null && value == null) {
attributeList.removeNamedItem(propertyName);
} else if (attributeList.getNamedItem(propertyName) == null && value != null) {
Attr property = this.getDocument().createAttribute(propertyName);
property.setValue(propertyName);
property.setTextContent(value);
attributeList.setNamedItem(property);