I am trying to use Pythons LXML library to create a GPX file that can be read by Garmin\'s Mapsource Product. The header on their GPX files looks like this
The problem is with your attribute name.
attrib={"{xsi}schemaLocation" : schemaLocation},
puts schemaLocation in the xsi namespace.
I think you meant
attrib={"{" + xsi + "}schemaLocation" : schemaLocation}
to use the URL for xsi. This matches your uses of namespace variables in the element name. It puts the attribute in the http://www.w3.org/2001/XMLSchema-instance
namespace
That gives the result of