def get_attributes(xml_node):
    """ When given an XML node, return a dictionary object
    with all of the key/values as specified in the XML"""
    rec = {}
    if not xml_node.hasAttributes():
        return rec

    for i in range(0, xml_node.attributes.length):
        attr_node = xml_node.attributes.item(i)
        rec[attr_node.name] = attr_node.value

    return rec