XMLWriter.to_string

XMLWriter.to_string(encoding='utf-8', prettify=False)[source]

Convert the XML element tree to a string.

Parameters
  • encoding (str, optional) – The encoding to use for the conversion.

  • prettify (bool, optional) – If True, prettify the string representation by adding whitespace and indentation.

Returns

str