docs: def _sanitize(self, value):
          """
          Remove the control characters that are not allowed in XML:
          https://www.w3.org/TR/xml/#charsets
          Leave all other characters.
          """
          if isinstance(value, six.binary_type):
              value = value.decode('utf-8')
          if isinstance(value, six.text_type):
              new_value = ''.join(ch for ch in value if self._valid_char(ch))
          else:
              return value
          # The new string will be equivalent to the original string if no control characters are present.
          # If equivalent, return the original string - some tests check for object equality instead of string equality.
          return value if value == new_value else new_value