Returns the int value of an element, or a default if it's not defined
    :param element: The XML Element object
    :type  element: etree._Element

    :param name: The name of the element to evaluate
    :type  name: str

    :param default: The default value to return if the element is not defined
    :type  default: int

    :rtype: int

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

    :param name: The name of the element to evaluate
    :type  name: str

    :param default: The default value to return if the element is not defined
    :type  default: int

    :rtype: int
    """
    element_value = element.find(name)

    if element_value is not None:
        try:
            return int(element_value.text)
        except (TypeError, ValueError):
            return default

    return default