code: def read_xml_file(input_filename):
      """
      Convert the CINTIL xml file to id & test
  
      Returns a list of tuples: (id, text)
      """
      with open(input_filename, encoding="utf-8") as fin:
          dataset = ET.parse(fin)
      dataset = dataset.getroot()
      corpus = dataset.find("{http://nlx.di.fc.ul.pt}corpus")
      if not corpus:
          raise ValueError("Unexpected dataset structure : no 'corpus'")
      trees = []
      for sentence in corpus:
          if sentence.tag != "{http://nlx.di.fc.ul.pt}sentence":
              raise ValueError(
                  "Unexpected sentence tag: {}".format(sentence.tag)
              )
          id_node = None
          raw_node = None
          tree_nodde = None
          for node in sentence:
              if node.tag == "{http://nlx.di.fc.ul.pt}id":
                  id_node = node
              elif node.tag == "{http://nlx.di.fc.ul.pt}raw":
                  raw_node = node
              elif node.tag == "{http://nlx.di.fc.ul.pt}tree":
                  tree_node = node
              else:
                  raise ValueError(
                      "Unexpected tag in sentence {}: {}".format(
                          sentence, node.tag
                      )
                  )
          if id_node is None or raw_node is None or tree_node is None:
              raise ValueError(
                  "Missing node in sentence {}".format(sentence)
              )
          tree_id = "".join(id_node.itertext())
          tree_text = "".join(tree_node.itertext())
          trees.append((tree_id, tree_text))
      return trees
  
imports: import xml.etree.ElementTree
  from stanza.models.constituency import tree_reader
  from stanza.utils.datasets.constituency import utils
label_desc: Use image node_id 1 for calling a global function with example usage: read_xml_file(input_filename) and returns: trees