def to_xml(self, version=None):
        if not version:
            if self.version:
                version = self.version
            else:
                version = '1.0'

        if version != '1.0' and version != '1.1':
            raise GPXException('Invalid version %s' % version)

        self.version = version
        if not self.creator:
            self.creator = 'gpx.py -- https://github.com/tkrajina/gpxpy'

        v = version.replace('.', '/')
        xml_attributes = {
                'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
                'xmlns': 'http://www.topografix.com/GPX/%s' % v,
                'xsi:schemaLocation': 'http://www.topografix.com/GPX/%s http://www.topografix.com/GPX/%s/gpx.xsd' % (v, v)
        }

        content = mod_gpxfield.gpx_fields_to_xml(self, 'gpx', version, custom_attributes=xml_attributes)

        return '<?xml version="1.0" encoding="UTF-8"?>\n' + content.strip()
write lines, one by one, separated by 
dataset/ETHPy150Open tkrajina/gpxpy/gpxpy/gpx.py/GPX.to_xml--crossover with--dataset/ETHPy150Open kmpm/nodemcu-uploader/nodemcu_uploader/uploader.py/Uploader.write_lines