public static boolean includesProperty(Element element, String name) {
        String[] propName = parsePropertyName(name);

        // Grab the attribute if there is one
        String lastName = propName[propName.length - 1];
        String attName = null;
        int attributeIndex = lastName.indexOf(':');
        if (attributeIndex >= 0) {
            propName[propName.length - 1] = lastName.substring(0, attributeIndex);
            attName = lastName.substring(attributeIndex + 1);
        }

        // Search for this property by traversing down the XML hierarchy.
        int i = propName[0].equals(element.getName()) ? 1 : 0;
        for (; i < propName.length; i++) {
            element = element.element(propName[i]);
            if (element == null) {
                break;
            }
        }

        if (element != null) {
            if (attName == null){
                // The property exists so return true
                return true;
            } else {
                // The property exists if the attribute exists in the element
                return element.attribute(attName) != null;
            }
        }
        else {
            // The property does not exist so return false
            return false;
        }
    }
Returns true if the specified property is included in the XML hierarchy. A property could
have a value associated or not. If the property has an associated value then

@param element the element to check
@param name the name of the property to find out.
@return true if the specified property is included in the XML hierarchy.
xmppserver/src/main/java/org/jivesoftware/util/ElementUtil.java