code: public void writePlacemark(XMLStreamWriter xmlOut, ResultSet rs, int geoFieldIndex, String spatialFieldName) throws XMLStreamException, SQLException {
          xmlOut.writeStartElement("Placemark");
          if (columnCount > 1) {
              writeExtendedData(xmlOut, rs);
          }
          StringBuilder sb = new StringBuilder();
          Geometry geom = (Geometry) rs.getObject(geoFieldIndex);
          int inputSRID = geom.getSRID();
          if (inputSRID == 0) {
              throw new SQLException("A coordinate reference system must be set to save the KML file");
          } else if (inputSRID != 4326) {
              throw new SQLException("The kml format supports only the WGS84 projection. \n"
                      + "Please use ST_Transform(" + spatialFieldName + "," + inputSRID + ")");
          }
          KMLGeometry.toKMLGeometry(geom, ExtrudeMode.NONE, AltitudeMode.NONE, sb);
          //Write geometry
          xmlOut.writeCharacters(sb.toString());
          xmlOut.writeEndElement();//Write Placemark
      }
docs: A Placemark is a Feature with associated Geometry.
  
  Syntax :
  
  <Placemark id="ID">
  <!-- inherited from Feature element -->
  <name>...</name> <!-- string -->
  <visibility>1</visibility> <!-- boolean -->
  <open>0</open> <!-- boolean -->
  <atom:author>...<atom:author> <!-- xmlns:atom -->
  <atom:link href=" "/> <!-- xmlns:atom -->
  <address>...</address> <!-- string -->
  <xal:AddressDetails>...</xal:AddressDetails> <!-- xmlns:xal -->
  <phoneNumber>...</phoneNumber> <!-- string -->
  <Snippet maxLines="2">...</Snippet> <!-- string -->
  <description>...</description> <!-- string -->
  <AbstractView>...</AbstractView> <!-- Camera or LookAt -->
  <TimePrimitive>...</TimePrimitive>
  <styleUrl>...</styleUrl> <!-- anyURI -->
  <StyleSelector>...</StyleSelector>
  <Region>...</Region>
  <Metadata>...</Metadata> <!-- deprecated in KML 2.2 -->
  <ExtendedData>...</ExtendedData> <!-- new in KML 2.2 -->
  
  <!-- specific to Placemark element -->
  <Geometry>...</Geometry>
  </Placemark>
  
  @param xmlOut