Index: trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java	(revision 3136)
+++ trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java	(revision 3137)
@@ -11,4 +11,5 @@
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
@@ -54,4 +55,22 @@
 
     /**
+     * Creates a tag collection from a map of key/value-pairs. Replies
+     * an empty tag collection if {@code tags} is null.
+     * 
+     * @param tags  the key/value-pairs
+     * @return the tag collection
+     */
+    public static TagCollection from(Map<String,String> tags) {
+        TagCollection ret = new TagCollection();
+        if (tags == null) return ret;
+        for (Entry<String,String> entry: tags.entrySet()) {
+            String key = entry.getKey() == null? "" : entry.getKey();
+            String value = entry.getValue() == null ? "" : entry.getValue();
+            ret.add(new Tag(key,value));
+        }
+        return ret;
+    }
+
+    /**
      * Creates a tag collection from the union of the tags managed by
      * a collection of primitives. Replies an empty tag collection,
Index: trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 3136)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java	(revision 3137)
@@ -22,4 +22,5 @@
 import org.openstreetmap.josm.command.SequenceCommand;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.TagCollection;
 import org.openstreetmap.josm.data.osm.Tagged;
 
@@ -331,4 +332,27 @@
 
     /**
+     * Initializes the model with the tags in a tag collection. Removes
+     * all tags if {@code tags} is null.
+     *
+     * @param tags the tags
+     */
+    public void initFromTags(TagCollection tags) {
+        clear();
+        if (tags == null){
+            setDirty(false);
+            return;
+        }
+        for (String key : tags.getKeys()) {
+            String value = tags.getJoinedValues(key);
+            add(key,value);
+        }
+        sort();
+        // add an empty row
+        TagModel tag = new TagModel();
+        this.tags.add(tag);
+        setDirty(false);
+    }
+
+    /**
      * applies the current state of the tag editor model to a primitive
      *
@@ -370,4 +394,13 @@
         applyToTags(tags);
         return tags;
+    }
+
+    /**
+     * Replies the the tags in this tag editor model as {@see TagCollection}.
+     * 
+     * @return the the tags in this tag editor model as {@see TagCollection}
+     */
+    public TagCollection getTagCollection() {
+        return TagCollection.from(getTags());
     }
 
