Element attributes are easily accessing using one of following methods:

String getAttributeStaticStr(String attName)
Method returns attribute value for passed attribute name. It will return null if attribute is not set.
Map<String, String> getAttributes()
Method returns a map of attributes which are set for this XML element.

You may easily modify attribute values by using one of following methods:

void setAttribute(String key, String value)
Set value for the attribute. Does not support null value. To remove a value for attribute, you need to use removeAttribute() method.
void setAttributes(Map<String, String> newAttributes)
Sets attributes for element to attribute and values passed in provided map.
void removeAttribute(String key)
Removes attribute and its value from element attributes.