function [kml_string]=make_kml_string(data);
% make_kml_string     - generates the contents for a kml file 
%
% usage: []=make_kml_string(data);
%
%
%  Falk Amelung and Scott Baker, May 2007
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   image_file = 'image_overlay.jpg';

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %%%%%%%%%%% Get the Coordinates %%%%%%%%%
   north_coord = bounds(4);
   south_coord = bounds(6);
   east_coord = bounds(3);
   west_coord = bounds(1);

   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   header1 = ['<?xml version="1.0" encoding="UTF-8"?>\n',...
            '<kml xmlns="http://earth.google.com/kml/2.1">\n',...
            '<Document>\n',...
            '<name>\n',...
            filename,...
            '\n</name>\n',...
            '<description>\n',...
            'Image overaly created with geodmod',...
            '</description>',...
            '<GroundOverlay>\n',...
            '<Icon>\n',...
               image_file,...
            '\n</Icon>\n',...
            '<LatLonBox>\n'];

     coords = [ sprintf('\t<north>%.6f</north>',north_coord),...
                sprintf('\n\t<south>%.6f</south>', south_coord),...
                sprintf('\n\t<east>%.6f</east>', east_coord),...
                sprintf('\n\t<west>%.6f</west>', west_coord)];

   footer1 = ['\n</LatLonBox>\n',...
       '</GroundOverlay>\n',...
       '</Document>\n',...
       '</kml>\n'];

   kml_string = strcat(header1,coords,footer1);
