def import_xml(self, xml_gzipped_file_path, taxids=None, silent=False):
version = self.session.query(models.Version).filter(models.Version.knowledgebase == '<STR_LIT>').first()<EOL>version.import_start_date = datetime.now()<EOL>entry_xml = '<STR_LIT>'<EOL>number_of_entries = <NUM_LIT:0><EOL>interval = <NUM_LIT:1000><EOL>start = False<EOL>if sys.platform in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>log.info('<STR_LIT>'.format(xml_gzipped_file_path))<EOL>zcat_command = '<STR_LIT>' if sys.platform == '<STR_LIT>' else '<STR_LIT>'<EOL>number_of_lines = int(getoutput("<STR_LIT>".format(zcat_command, xml_gzipped_file_path)))<EOL>tqdm_desc = '<STR_LIT>'.format(number_of_lines)<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL>number_of_lines = None<EOL>tqdm_desc = None<EOL><DEDENT>with gzip.open(xml_gzipped_file_path) as fd:<EOL><INDENT>for line in tqdm(fd, desc=tqdm_desc, total=number_of_lines, mininterval=<NUM_LIT:1>, disable=silent):<EOL><INDENT>end_of_file = line.startswith(b"<STR_LIT>")<EOL>if line.startswith(b"<STR_LIT>"):<EOL><INDENT>start = True<EOL><DEDENT>elif end_of_file:<EOL><INDENT>start = False<EOL><DEDENT>if start:<EOL><INDENT>entry_xml += line.decode("<STR_LIT:utf-8>")<EOL><DEDENT>if line.startswith(b"<STR_LIT>") or end_of_file:<EOL><INDENT>number_of_entries += <NUM_LIT:1><EOL>start = False<EOL>if number_of_entries == interval or end_of_file:<EOL><INDENT>entry_xml += "<STR_LIT>"<EOL>self.insert_entries(entry_xml, taxids)<EOL>if end_of_file:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>entry_xml = "<STR_LIT>"<EOL>number_of_entries = <NUM_LIT:0><EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>version.import_completed_date = datetime.now()<EOL>self.session.commit()<EOL>
Imports XML

        :param str xml_gzipped_file_path: path to XML file
        :param Optional[list[int]] taxids: NCBI taxonomy identifier
        :param bool silent: no output if True