class_docstr: Subclass for formatting data in XML.
  
  Parameters
  ----------
  path_or_buffer : str or file-like
      This can be either a string of raw XML, a valid URL,
      file or file-like object.
  
  index : bool
      Whether to include index in xml document.
  
  row_name : str
      Name for root of xml document. Default is 'data'.
  
  root_name : str
      Name for row elements of xml document. Default is 'row'.
  
  na_rep : str
      Missing data representation.
  
  attrs_cols : list
      List of columns to write as attributes in row element.
  
  elem_cols : list
      List of columns to write as children in row element.
  
  namespaces : dict
      The namespaces to define in XML document as dicts with key
      being namespace and value the URI.
  
  prefix : str
      The prefix for each element in XML document including root.
  
  encoding : str
      Encoding of xml object or document.
  
  xml_declaration : bool
      Whether to include xml declaration at top line item in xml.
  
  pretty_print : bool
      Whether to write xml document with line breaks and indentation.
  
  stylesheet : str or file-like
      A URL, file, file-like object, or a raw string containing XSLT.
  
  {compression_options}
  
      .. versionchanged:: 1.4.0 Zstandard support.
  
  {storage_options}
  
  See also
  --------
  pandas.io.formats.xml.EtreeXMLFormatter
  pandas.io.formats.xml.LxmlXMLFormatter
code: def __init__(
      self,
      frame: DataFrame,
      path_or_buffer: FilePath
      | WriteBuffer[bytes]
      | WriteBuffer[str]
      | None = None,
      index: bool = True,
      root_name: str | None = "data",
      row_name: str | None = "row",
      na_rep: str | None = None,
      attr_cols: list[str] | None = None,
      elem_cols: list[str] | None = None,
      namespaces: dict[str | None, str] | None = None,
      prefix: str | None = None,
      encoding: str = "utf-8",
      xml_declaration: bool | None = True,
      pretty_print: bool | None = True,
      stylesheet: FilePath
      | ReadBuffer[str]
      | ReadBuffer[bytes]
      | None = None,
      compression: CompressionOptions = "infer",
      storage_options: StorageOptions = None,
  ) -> None:
      self.frame = frame
      self.path_or_buffer = path_or_buffer
      self.index = index
      self.root_name = root_name
      self.row_name = row_name
      self.na_rep = na_rep
      self.attr_cols = attr_cols
      self.elem_cols = elem_cols
      self.namespaces = namespaces
      self.prefix = prefix
      self.encoding = encoding
      self.xml_declaration = xml_declaration
      self.pretty_print = pretty_print
      self.stylesheet = stylesheet
      self.compression = compression
      self.storage_options = storage_options
  
      self.orig_cols = self.frame.columns.tolist()
      self.frame_dicts = self.process_dataframe()
  
      self.validate_columns()
      self.validate_encoding()
      self.prefix_uri = self.get_prefix_uri()
      self.handle_indexes()
  
imports: from __future__ import annotations
  import codecs
  import io
  from typing import TYPE_CHECKING, Any
  from pandas._typing import CompressionOptions, FilePath, ReadBuffer, StorageOptions, WriteBuffer
  from pandas.errors import AbstractMethodError
  from pandas.util._decorators import doc
  from pandas.core.dtypes.common import is_list_like
  from pandas.core.dtypes.missing import isna
  from pandas.core.shared_docs import _shared_docs
  from pandas.io.common import get_handle
  from pandas.io.xml import get_data_from_filepath, preprocess_data
label_desc: Use image node_id 1 to create a new BaseXMLFormatter object  with example: obj = BaseXMLFormatter(frame, path_or_buffer, index, root_name, row_name, na_rep, attr_cols, elem_cols, namespaces, prefix, encoding, xml_declaration, pretty_print, stylesheet, compression, storage_options)