code: def _getsubnodetext(node, name):
      """Get an element from an XML node, raise an error otherwise.
  
      Parameters
      ----------
      node: Element
          XML Element
      name: str
          Child element name
  
      Returns
      -------
      test: str
          Text contents of the child nodes
      """
      subnode = node.findtext(name)
      if not subnode:
          raise RuntimeError("NEDF header " + name + " not found")
      return subnode
  
file_path: mne-python/mne/io/nedf/nedf.py
imports: from copy import deepcopy
  from datetime import datetime, timezone
  import numpy
  from ..._fiff.meas_info import create_info
  from ..._fiff.utils import _mult_cal_one
  from ...utils import _check_fname, _soft_import, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 1 for calling a global function with example usage: _getsubnodetext(node, name) and returns: subnode