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 samp
KML is just XML and there are various methods for generating XML files in Cocoa, e.g. using KissXML.
The KML format is documented here: http://code.google.com/apis/kml/documentation/kmlreference.html.