def get_float_attr(node, attribute, default=None):
    """Cast an element attribute to a float or return None if not present"""
    attr = node.get(attribute)
    return default if attr is None else float(attr)
