'Read the metadata attributes from this xml_object.
Returns a dictionary {key: value}.'

@classmethod
def load_metadata(cls, xml_object):

    metadata = {'xml_attributes': {}}
    for (attr, val) in xml_object.attrib.iteritems():
        attr = cls._translate(attr)
        if (attr in cls.metadata_to_strip):
            if (attr in ('course', 'org', 'url_name', 'filename')):
                dog_stats_api.increment(DEPRECATION_VSCOMPAT_EVENT, tags=('location:xmlparser_util_mixin_load_metadata', 'metadata:{}'.format(attr)))
            continue
        if (attr not in cls.fields):
            metadata['xml_attributes'][attr] = val
        else:
            metadata[attr] = deserialize_field(cls.fields[attr], val)
    return metadata
