def _upload_instance(self, xml_file, instance_dir_path, files):
        xml_doc = clean_and_parse_xml(xml_file.read())
        xml = StringIO()
        de_node = xml_doc.documentElement
        for node in de_node.firstChild.childNodes:
            xml.write(node.toxml())
        new_xml_file = ContentFile(xml.getvalue())
        new_xml_file.content_type = 'text/xml'
        xml.close()
        attachments = []

        for attach in de_node.getElementsByTagName('mediaFile'):
            filename_node = attach.getElementsByTagName('filename')
            filename = filename_node[0].childNodes[0].nodeValue
            if files in filename:
                file_obj = default_storage.open(
                    os.path.join(instance_dir_path, filename))
                mimetype, encoding = mimetypes.guess_type(file_obj.name)
                media_obj = django_file(file_obj, 'media_files[]', mimetype)
                attachments.append(media_obj)

        create_instance(self.user.username, new_xml_file, attachments)
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/utils/briefcase_client.py/BriefcaseClient._upload_instance/swapped operands of `in`