+ # get ways
+ # find which ways are needed
+ segment_ids = segments.collect {|segment| segment.id }
+ ways = Array.new
+ if segment_ids.length > 0
+ way_segments = WaySegment.find_by_segment_id(segment_ids)
+ way_ids = way_segments.collect {|way_segment| way_segment.id }
+
+ ways = Way.find(segment_ids)
+ end
+
+ nodes.each do |node|
+ root << node.to_xml_node()
+ end
+
+ segments.each do |segment|
+ root << segment.to_xml_node()
+ end
+
+ ways.each do |way|
+ root << way.to_xml_node()
+ end
+