def to_xml(self, value, version):
        if not value:
            return ''

        if self.attribute:
            return '%s="%s"' % (self.attribute, mod_utils.make_str(value))
        else:
            if self.type_converter:
                value = self.type_converter.to_string(value)
            if isinstance(self.tag, list) or isinstance(self.tag, tuple):
                raise Exception('Not yet implemented')
            return mod_utils.to_xml(self.tag, content=value, escape=True)
dataset/ETHPy150Open tkrajina/gpxpy/gpxpy/gpxfield.py/GPXField.to_xml/original