MultiPolygon geom = factory.createMultiPolygon(new Polygon[]{polygon});
geom.setUserData("EPSG:4326");
final StringWriter writer = new StringWriter();
// DocumentWriter.writeDocument(geom, schema, writer, new HashMap());
PrintHandler output=new PrintHandler(){
public void characters(char[] arg0, int arg1, int arg2) throws IOException {
writer.write(arg0, arg1, arg2);
}