#include <iostream>
#include <sstream>
#include <string>

std::string FormatPlacemark(double, double, double, double);

int main() {
	std::cout << "<?xml version='1.0' encoding='utf-8'?>\n";
	std::cout << "<kml xmlns='http://w...content-available-to-author-only...s.net/kml/2.2'>\n";

	std::string placemark = FormatPlacemark(-76.2, 38.5, -76.1, 38.6);
	std::cout << placemark;

	std::cout << "</kml>\n";

	return 0;
}

std::string FormatPlacemark(double lat1, double long1, double lat2, double long2)
{
    std::ostringstream ss;
    ss << "<Placemark>\n"
       << "<name>Path</name>\n"
       << "<description>This is the path between the 2 points</description>\n"
       << "<styleUrl>#pathstyle</styleUrl>\n"
       << "<LineString>\n"
       << "<tessellate>1</tessellate>\n"
       << "<coordinates>"
       << long1 << "," << lat1 << ",0"
       << " "
       << long2 << "," << lat2 << ",0"
       << "</coordinates>\n"
       << "</LineString>\n"
       << "</Placemark>\n";

    return ss.str();
}