title: Generate KML file within iphone app
body: <p>In my app i have to draw route between user location and destination location in MKMapView with help of MKAnnotation and MKOverlay classes. I had gone through the KMLViewer sample code from apple in there they mentioned to create KML file outside the programming steps, but i need KML file generation inside iPhone app programming.</p>
  
  <p>is it possible? and i need help on doing that..</p>
  
  <p><strong>Steps to get KML file manually</strong></p>
  
  <p>The process to obtain a KML is as follows:</p>
  
  <ul>
  <li>Go to: "http://maps.google.com/"</li>
  <li>Click "Get Directions" link</li>
  <li>Type in the start and destination addresses
  (for example)
  <strong>Start</strong> = 451 University Avenue, Palo Alto, CA 94301
  <strong>Destination</strong> = #1 Infinite Loop, Cupertino, CA 95014</li>
  <li>Modify the route as you wish.</li>
  <li>Click the "Link" to this page link.</li>
  <li>Copy the email/IM link.</li>
  <li>Paste the link back into your Safari's address bar.</li>
  <li>Add &amp;output=kml to the end of the url and press the enter key.</li>
  <li>The KML file will be downloaded to your Downloads folder. </li>
  </ul>
  
  <p>but i need this to be done programmatically...</p>