Index: src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmReader.java	(revision 15466)
+++ src/org/openstreetmap/josm/io/OsmReader.java	(working copy)
@@ -39,6 +39,8 @@
 
     protected XMLStreamReader parser;
 
+    protected boolean convertUnknownToTags;
+
     /**
      * constructor (for private and subclasses use only)
      *
@@ -45,7 +47,19 @@
      * @see #parseDataSet(InputStream, ProgressMonitor)
      */
     protected OsmReader() {
+        this(false);
+    }
+
+    /**
+     * constructor (for private and subclasses use only)
+     * @param convertUnknownToTags if true, keep unknown xml attributes as tags
+     *
+     * @see #parseDataSet(InputStream, ProgressMonitor)
+     * @since xxx
+     */
+    protected OsmReader(boolean convertUnknownToTags) {
         // Restricts visibility
+        this.convertUnknownToTags = convertUnknownToTags;
     }
 
     protected void setParser(XMLStreamReader parser) {
@@ -386,13 +400,43 @@
      */
     private void readCommon(PrimitiveData current) throws IllegalDataException {
         try {
-            parseId(current, getLong("id"));
-            parseTimestamp(current, parser.getAttributeValue(null, "timestamp"));
-            parseUser(current, parser.getAttributeValue(null, "user"), parser.getAttributeValue(null, "uid"));
-            parseVisible(current, parser.getAttributeValue(null, "visible"));
-            parseVersion(current, parser.getAttributeValue(null, "version"));
-            parseAction(current, parser.getAttributeValue(null, "action"));
-            parseChangeset(current, parser.getAttributeValue(null, "changeset"));
+            boolean addedUser = false;
+            for (int i = 0; i < parser.getAttributeCount(); i++) {
+                switch (parser.getAttributeLocalName(i)) {
+                case "id":
+                    parseId(current, getLong("id"));
+                    break;
+                case "timestamp":
+                    parseTimestamp(current, parser.getAttributeValue(null, "timestamp"));
+                    break;
+                case "user":
+                case "uid":
+                    if (!addedUser) {
+                        parseUser(current, parser.getAttributeValue(null, "user"), parser.getAttributeValue(null, "uid"));
+                        addedUser = true;
+                    }
+                    break;
+                case "visible":
+                    parseVisible(current, parser.getAttributeValue(null, "visible"));
+                    break;
+                case "version":
+                    parseVersion(current, parser.getAttributeValue(null, "version"));
+                    break;
+                case "action":
+                    parseAction(current, parser.getAttributeValue(null, "action"));
+                    break;
+                case "changeset":
+                    parseChangeset(current, parser.getAttributeValue(null, "changeset"));
+                    break;
+                case "lat":
+                case "lon":
+                    break;
+                default:
+                    if (convertUnknownToTags) {
+                        parseTag(current, parser.getAttributeLocalName(i), parser.getAttributeValue(i));
+                    }
+                }
+            }
         } catch (UncheckedParseException | XMLStreamException e) {
             throw new IllegalDataException(e);
         }
@@ -457,6 +501,23 @@
      * @throws IllegalArgumentException if source is null
      */
     public static DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException {
-        return new OsmReader().doParseDataSet(source, progressMonitor);
+        return parseDataSet(source, progressMonitor, false);
     }
+
+    /**
+     * Parse the given input source and return the dataset.
+     *
+     * @param source the source input stream. Must not be null.
+     * @param progressMonitor the progress monitor. If null, {@link NullProgressMonitor#INSTANCE} is assumed
+     * @param convertUnknownToTags true if unknown xml attributes should be kept as tags
+     *
+     * @return the dataset with the parsed data
+     * @throws IllegalDataException if an error was found while parsing the data from the source
+     * @throws IllegalArgumentException if source is null
+     * @since xxx
+     */
+    public static DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor, boolean convertUnknownToTags)
+            throws IllegalDataException {
+        return new OsmReader(convertUnknownToTags).doParseDataSet(source, progressMonitor);
+    }
 }
