def parse_attributes(xml_elem, parse_input):
    """ Parse xml input:

    Arguments:
        xml_elem: an XML parsing element containing an "attributes" member
        parse_input: [["attribute_name", python_type_name],
                      ["52", int], ["1.234", float], ["neurite", str], ...]
    Returns:
        list of python-typed values - [52, 1.234, "neurite", ...]
    """
    parse_output = []
    attributes = xml_elem.attributes
    for x in parse_input:
        try:
            if x[1] == int:
                # ensure float strings can be parsed too
                parse_output.append(int(float(attributes[x[0]].value)))
            else:
                parse_output.append(x[1](attributes[x[0]].value))
        except (KeyError, ValueError):
            parse_output.append(None)
    return parse_output