def attribute(element, attribute, default=None):
    """
    Returns the value of an attribute, or a default if it's not defined
    :param element: The XML Element object
    :type  element: etree._Element

    :param attribute: The name of the attribute to evaluate
    :type  attribute: basestring

    :param default: The default value to return if the attribute is not defined
    """
    attribute_value = element.get(attribute)

    return attribute_value if attribute_value is not None else default
Returns the value of an attribute, or a default if it's not defined
    :param element: The XML Element object
    :type  element: etree._Element

    :param attribute: The name of the attribute to evaluate
    :type  attribute: basestring

    :param default: The default value to return if the attribute is not defined