code: function(features) { 
          if (!(OpenLayers.Util.isArray(features))) {
              features = [features];
          }
          
          this.osm_id = 1;
          this.created_nodes = {};
          var root_node = this.createElementNS(null, "osm");
          root_node.setAttribute("version", "0.5");
          root_node.setAttribute("generator", "OpenLayers "+ OpenLayers.VERSION_NUMBER);
  
          // Loop backwards, because the deserializer puts nodes last, and 
          // we want them first if possible
          for(var i = features.length - 1; i >= 0; i--) {
              var nodes = this.createFeatureNodes(features[i]);
              for (var j = 0; j < nodes.length; j++) {
                  root_node.appendChild(nodes[j]);
              }    
          }
          return OpenLayers.Format.XML.prototype.write.apply(this, [root_node]);
      }
docs: APIMethod: write
  Takes a list of features, returns a serialized OSM format file for use
  in tools like JOSM.
  
  Parameters:
  features - {Array(<OpenLayers.Feature.Vector>)}