def enc_encode(self, strg):
        """ Encode a formatted XML document in target"""
        if sys.version_info > (3, 0):
            return strg.encode(self.encoding_effective)  # v3
        return strg.decode("utf-8").encode(self.encoding_effective)  # v2