code: def translate(self, *args: Any, **kwargs: Any) -> None:
      self.document.settings.newlines = (
          self.document.settings.indents
      ) = self.builder.env.config.xml_pretty
      self.document.settings.xml_declaration = True
      self.document.settings.doctype_declaration = True
      return super().translate()
  
file_path: sphinx/sphinx/writers/xml.py
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any
  from docutils.writers.docutils_xml import Writer
label_desc: Use image node_id 2 for calling the XMLWriter obj's underlying member method code with example usage: obj.translate() and returns: super