To create a KML file, Use the text editor and then rename the extension to KML.
This is a sample code(I deleted a lot of the coordinates to make it small) for a KML file with the polygon. For reasons, unknown to me, it appears the longitude needs to be first to draw it properly.