class_docstr: Class for formatting data in xml using Python standard library
  modules: `xml.etree.ElementTree` and `xml.dom.minidom`.
docstr: Add xml declaration.
  
  This method will add xml declaration of working tree. Currently,
  xml_declaration is supported in etree starting in Python 3.8.
docstr_tok: ["Add","xml","declaration",".","This","method","will","add","xml","declaration","of","working","tree",".","Currently",",","xml_declaration","is","supported","in","etree","starting","in","Python","3.8","."]
code: def add_declaration(self) -> bytes:
      """
      Add xml declaration.
  
      This method will add xml declaration of working tree. Currently,
      xml_declaration is supported in etree starting in Python 3.8.
      """
      decl = f'<?xml version="1.0" encoding="{self.encoding}"?>\n'
  
      return (
          self.out_xml
          if self.out_xml.startswith(b"<?xml")
          else decl.encode(self.encoding) + self.out_xml
      )
  
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 5 for calling the EtreeXMLFormatter obj's underlying member method code with example usage: obj.add_declaration() and returns: unknown