diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Format/SLD/v1.js
+++ b/lib/OpenLayers/Format/SLD/v1.js
@@ -667,8 +667,16 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
             },
             "PolygonSymbolizer": function(symbolizer) {
                 var node = this.createElementNSPlus("PolygonSymbolizer");
-                this.writeNode(node, "Fill", symbolizer);
-                this.writeNode(node, "Stroke", symbolizer);
+                if(symbolizer.fillColor != undefined ||
+                                    symbolizer.fillOpacity != undefined) {
+                    this.writeNode(node, "Fill", symbolizer);
+                }
+                if(symbolizer.strokeWidth != undefined ||
+                                    symbolizer.strokeColor != undefined ||
+                                    symbolizer.strokeOpacity != undefined ||
+                                    symbolizer.strokeDashstyle != undefined) {
+                    this.writeNode(node, "Stroke", symbolizer);
+                }
                 return node;
             },
             "Fill": function(symbolizer) {
Create Fill and Stroke nodes only for PolygonSymbolizers that actually have fill and stroke symbolizer properties. r=tschaub (closes #<I>)

git-svn-id: <URL>