XML.to_string

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

Generate a string representation of this XML instance, including all sub-elements.

Parameters:
encodingstr, optional

Output encoding.

prettifybool, optional

If True, prettify the string representation by adding whitespace and indentation.

Returns:
str

String representation of the XML.