public String removeAttribute(String name, String attribute) {
        if (name == null || attribute == null) {
            return null;
        }
        String[] propName = parsePropertyName(name);
        // Search for this property by traversing down the XML hierarchy.
        final Lock writeLock = readWriteLock.writeLock();
        writeLock.lock();
        try {
            Element element = document.getRootElement();
            for (String child : propName) {
                element = element.element(child);
                if (element == null) {
                    // This node doesn't match this part of the property name which
                    // indicates this property doesn't exist so return empty array.
                    break;
                }
            }
            String result = null;
            if (element != null) {
                // Get the attribute value and then remove the attribute
                Attribute attr = element.attribute(attribute);
                result = attr.getValue();
                element.remove(attr);
            }
            return result;
        } finally {
            writeLock.unlock();
        }
    }
Removes the given attribute from the XML document.

@param name the property name to lookup - ie, "foo.bar"
@param attribute the name of the attribute, ie "id"
@return the value of the attribute of the given property or {@code null} if
     it did not exist.
xmppserver/src/main/java/org/jivesoftware/util/XMLProperties.java