class_docstr: A list of name-value pairs used in various Caret-based XML formats
  
  * Description - Provides a simple method for user-supplied metadata that
    associates names with values.
  * Attributes: [NA]
  * Child Elements
  
      * MD (0...N)
  
  * Text Content: [NA]
  
  MD elements are a single metadata entry consisting of a name and a value.
  
  Attributes
  ----------
  data : mapping of {name: value} pairs
  
  >>> md = CaretMetaData()
  >>> md['key'] = 'val'
  >>> md
  <CaretMetaData {'key': 'val'}>
  >>> dict(md)
  {'key': 'val'}
  >>> md.to_xml()
  b'<MetaData><MD><Name>key</Name><Value>val</Value></MD></MetaData>'
  
  Objects may be constructed like any ``dict``:
  
  >>> md = CaretMetaData(key='val')
  >>> md.to_xml()
  b'<MetaData><MD><Name>key</Name><Value>val</Value></MD></MetaData>'
code: def _to_xml_element(self):
      metadata = xml.Element("MetaData")
  
      for name_text, value_text in self._data.items():
          md = xml.SubElement(metadata, "MD")
          name = xml.SubElement(md, "Name")
          name.text = str(name_text)
          value = xml.SubElement(md, "Value")
          value.text = str(value_text)
      return metadata
  
file_path: nibabel/nibabel/caret.py
imports: from collections.abc import MutableMapping
  from .None import xmlutils
label_desc: Use image node_id 9 for calling the CaretMetaData obj's underlying member method code with example usage: obj._to_xml_element() and returns: metadata