code: public static String toGML(Geometry geom) {
          if (geom == null) {
              return null;
          }
          int srid = geom.getSRID();
          GMLWriter gmlw = new GMLWriter();
          if (srid != -1 || srid != 0) {
              gmlw.setSrsName("EPSG:" + geom.getSRID());
          }
          return gmlw.write(geom);
      }
docs: Write the GML
  @param geom
  @return