code: function(geometry) {
          var node,
              i,
              len,
              point,
              nodes;
          if (geometry.CLASS_NAME == "OpenLayers.Geometry.LineString" ||
              geometry.CLASS_NAME == "OpenLayers.Geometry.LinearRing") {
              node = this.createElementNS(this.namespaces.gpx, "trkseg");
              for (i = 0, len=geometry.components.length; i < len; i++) {
                  point = geometry.components[i];
                  node.appendChild(this.buildTrkPtNode(point));
              }
              return node;
          } else {
              nodes = [];
              for (i = 0, len = geometry.components.length; i < len; i++) {
                  nodes.push(this.buildTrkSegNode(geometry.components[i]));
              }
              return nodes;
          }
      }
docs: Method: buildTrkSegNode
  Builds trkseg node(s) given a geometry
  
  Parameters:
  trknode
  geometry - {<OpenLayers.Geometry>}