Index: /trunk/src/org/openstreetmap/josm/io/OsmWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 12018)
+++ /trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 12019)
@@ -33,14 +33,16 @@
 
 /**
- * Save the dataset into a stream as osm intern xml format. This is not using any
- * xml library for storing.
+ * Save the dataset into a stream as osm intern xml format. This is not using any xml library for storing.
  * @author imi
+ * @since 59
  */
 public class OsmWriter extends XmlWriter implements PrimitiveVisitor {
 
+    /** Default OSM API version */
     public static final String DEFAULT_API_VERSION = "0.6";
 
     private final boolean osmConform;
     private boolean withBody = true;
+    private boolean withVisible = true;
     private boolean isOsmChange;
     private String version;
@@ -60,6 +62,19 @@
     }
 
+    /**
+     * Sets whether body must be written.
+     * @param wb if {@code true} body will be written.
+     */
     public void setWithBody(boolean wb) {
         this.withBody = wb;
+    }
+
+    /**
+     * Sets whether 'visible' attribute must be written.
+     * @param wv if {@code true} 'visible' attribute will be written.
+     * @since 12019
+     */
+    public void setWithVisible(boolean wv) {
+        this.withVisible = wv;
     }
 
@@ -127,4 +142,5 @@
      */
     public void writeContent(DataSet ds) {
+        setWithVisible(UploadPolicy.NORMAL.equals(ds.getUploadPolicy()));
         writeNodes(ds.getNodes());
         writeWays(ds.getWays());
@@ -322,5 +338,7 @@
                 }
             }
-            out.print(" visible='"+osm.isVisible()+'\'');
+            if (withVisible) {
+                out.print(" visible='"+osm.isVisible()+'\'');
+            }
         }
         if (osm.getVersion() != 0) {
