def element_to_int(element, attribute=None):
if attribute is not None:<EOL><INDENT>return int(element.get(attribute))<EOL><DEDENT>else:<EOL><INDENT>return int(element.text)<EOL><DEDENT>
Convert ``element`` object to int. If attribute is not given, convert ``element.text``.

    :param element: ElementTree element
    :param attribute: attribute name
    :type attribute: str
    :returns: integer
    :rtype: int