code: def XMLRefine(input_xml, output_xml, readable=False):
      """refine trs file into
  
      :param input_xml: original transcriber xml
      :param output_xml: refined xml with contant in each trun
      :param readable: if the output file is readable (for debug & reading only)
      """
  
      if readable:
          append = "\n"
      else:
          append = ""
      sample_processing = open(input_xml, "r", encoding="iso-8859-1")
      output = open(output_xml, "w", encoding="iso-8859-1")
      stack = ""
      stack_symbol = ""
      while True:
          line = sample_processing.readline()
          if not line:
              break
          line = line.strip()
  
          if stack != "":
              if len(line) > 1 and line[0] == "<":
                  if line.startswith("<Who"):
                      continue
                  stack += "%s</%s>%s" % (append, stack_symbol, append)
                  output.write(stack)
                  if line[-2:] == "/>":
                      stack = line[:-2] + ">" + append
                      stack_symbol = line[1:].split(" ")[0]
                  else:
                      output.write(line + append)
                      stack, stack_symbol = "", ""
              else:
                  stack += line
          elif len(line) > 2 and line[-2:] == "/>":
              stack += line[:-2] + ">" + append
              stack_symbol = line[1:].split(" ")[0]
          else:
              output.write(line + append)
      sample_processing.close()
      output.close()
  
file_path: espnet/egs2/puebla_nahuatl/asr1/local/data_prep.py
imports: import os
  import re
  import shutil
  import string
  import sys
  from argparse import ArgumentParser
  from xml.dom.minidom import parse
label_desc: Use image node_id 3 for calling a global function with example usage: XMLRefine(input_xml, output_xml, readable) without return types