app/views/api/kml/lines/show.kml.erb
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name><%= h(Chouette::Line.model_name.human) %> : <%= h(@line.name) %></name>
<Placemark id="<%= @line.objectid %>" >
<name><%= h(@line.name) %></name>
<ExtendedData>
<% [ :transport_mode, :objectid, :object_version, :creation_time, :creator_id, :name, :number, :published_name, :registration_number, :comment, :mobility_restricted_suitability, :int_user_needs].each do |prop| %>
<Data name="<%= prop.to_s %>">
<value><%= h(@line.send( prop)) %></value>
</Data>
<% end %>
<Data name="company_objectid">
<value><%= h(@line.company.objectid) %></value>
</Data>
<Data name="network_objectid">
<value><%= h(@line.network.objectid) %></value>
</Data>
</ExtendedData>
<%= @line.geometry_presenter.geometry.kml_representation.html_safe %>
</Placemark>
</Document>
</kml>