code: def _xml2list(root):
      """Parse XML item."""
      output = []
      for element in root:
          if len(element) > 0:
              if element[0].tag != element[-1].tag:
                  output.append(_xml2dict(element))
              else:
                  output.append(_xml2list(element))
  
          elif element.text:
              text = element.text.strip()
              if text:
                  tag = _ns(element.tag)
                  output.append({tag: text})
  
      return output
  
file_path: mne-python/mne/io/egi/events.py
imports: from datetime import datetime
  from glob import glob
  from os.path import basename, join, splitext
  import numpy
  from ...utils import _soft_import, logger
label_desc: Use image node_id 4 for calling a global function with example usage: _xml2list(root) and returns: output