def __init__(self, encoding="unicode", xml_declaration=True):
        # type: (str, bool) -> None
        """
        :param encoding: XML encoding
        :param xml_declaration: Add XML declaration
        """
        if sys.version_info[0] < 3 and encoding == "unicode":
            # Small trick for Python 2.7
            encoding = "UTF-8"

        self._encoding = encoding
        self._xml_declaration = xml_declaration
def __init__ ( self , encoding = "unicode" , xml_declaration = True ) : if sys . version_info [ 0 ] < 3 and encoding == "unicode" : encoding = "UTF-8" self . _encoding = encoding self . _xml_declaration = xml_declaration
:param encoding: XML encoding
        :param xml_declaration: Add XML declaration