Index: src/org/openstreetmap/josm/data/coor/EastNorth.java
===================================================================
--- src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 71)
+++ src/org/openstreetmap/josm/data/coor/EastNorth.java	(revision 72)
@@ -21,3 +21,8 @@
 		return y;
 	}
+	
+	@Override
+	public String toString() {
+		return "(EastNorth e="+x+", n="+y+")";
+	}
 }
Index: src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 71)
+++ src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 72)
@@ -75,5 +75,5 @@
 				center.east() + (x - getWidth()/2.0)*scale,
 				center.north() - (y - getHeight()/2.0)*scale);
-		return Main.pref.getProjection().eastNorth2latlon(eastNorth);
+		return getProjection().eastNorth2latlon(eastNorth);
 	}
 
Index: src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmReader.java	(revision 71)
+++ src/org/openstreetmap/josm/io/OsmReader.java	(revision 72)
@@ -113,5 +113,5 @@
 	
 	@Override
-	public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+	public void endElement(String namespaceURI, String localName, String qName) {
 		if (qName.equals("node") || qName.equals("segment") || qName.equals("way") || qName.equals("area")) {
 			current.visit(adder);
Index: src/org/openstreetmap/josm/io/OsmWriter.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmWriter.java	(revision 71)
+++ src/org/openstreetmap/josm/io/OsmWriter.java	(revision 72)
@@ -12,5 +12,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
-import org.xml.sax.SAXException;
+import org.openstreetmap.josm.tools.XmlWriter;
 
 /**
@@ -20,12 +20,4 @@
  */
 public class OsmWriter implements Visitor {
-
-	private class RuntimeEncodingException extends RuntimeException {
-		public RuntimeEncodingException(Throwable t) {
-			super(t);
-		}
-		public RuntimeEncodingException() {
-		}
-	}
 
 	/**
@@ -46,16 +38,4 @@
 	private final boolean osmConform;
 
-	private final static HashMap<Character, String> encoding = new HashMap<Character, String>();
-	static {
-		encoding.put('<', "&lt;");
-		encoding.put('>', "&gt;");
-		encoding.put('"', "&quot;");
-		encoding.put('\'', "&apos;");
-		encoding.put('&', "&amp;");
-		encoding.put('\n', "&#xA;");
-		encoding.put('\r', "&#xD;");
-		encoding.put('\t', "&#x9;");
-	}
-	
 	/**
 	 * Output the data to the stream
@@ -77,14 +57,10 @@
 	}
 
-	public static void outputSingle(Writer out, OsmPrimitive osm, boolean osmConform) throws SAXException {
-		try {
-			OsmWriter writer = new OsmWriter(out, osmConform);
-			writer.out.println("<?xml version='1.0' encoding='UTF-8'?>");
-			writer.out.println("<osm version='0.3' generator='JOSM'>");
-			osm.visit(writer);
-			writer.out.println("</osm>");
-		} catch (RuntimeEncodingException e) {
-			throw new SAXException("Your Java installation does not support the required UTF-8 encoding", (Exception)e.getCause());
-		}		
+	public static void outputSingle(Writer out, OsmPrimitive osm, boolean osmConform) {
+		OsmWriter writer = new OsmWriter(out, osmConform);
+		writer.out.println(XmlWriter.header());
+		writer.out.println("<osm version='0.3' generator='JOSM'>");
+		osm.visit(writer);
+		writer.out.println("</osm>");
 	}
 
@@ -105,5 +81,5 @@
 	public void visit(LineSegment ls) {
 		if (ls.incomplete)
-			throw new IllegalArgumentException("Cannot write an incomplete LineSegment.");
+			return; // Do not write an incomplete line segment
 		addCommon(ls, "segment");
 		out.print(" from='"+getUsedId(ls.from)+"' to='"+getUsedId(ls.to)+"'");
@@ -137,6 +113,6 @@
 				out.println(">");
 			for (Entry<String, String> e : osm.keys.entrySet())
-				out.println("    <tag k='"+ encode(e.getKey()) +
-						"' v='"+encode(e.getValue())+ "' />");
+				out.println("    <tag k='"+ XmlWriter.encode(e.getKey()) +
+						"' v='"+XmlWriter.encode(e.getValue())+ "' />");
 			out.println("  </" + tagname + ">");
 		} else if (tagOpen)
@@ -145,23 +121,4 @@
 			out.println("  </" + tagname + ">");
 	}
-
-	/**
-	 * Encode the given string in XML1.0 format.
-	 * Optimized to fast pass strings that don't need encoding (normal case).
-	 */
-	public String encode(String unencoded) {
-		StringBuilder buffer = null;
-		for (int i = 0; i < unencoded.length(); ++i) {
-			String encS = encoding.get(unencoded.charAt(i));
-			if (encS != null) {
-				if (buffer == null)
-					buffer = new StringBuilder(unencoded.substring(0,i));
-				buffer.append(encS);
-			} else if (buffer != null)
-				buffer.append(unencoded.charAt(i));
-		}
-		return (buffer == null) ? unencoded : buffer.toString();
-	}
-
 
 	/**
Index: src/org/openstreetmap/josm/tools/XmlWriter.java
===================================================================
--- src/org/openstreetmap/josm/tools/XmlWriter.java	(revision 72)
+++ src/org/openstreetmap/josm/tools/XmlWriter.java	(revision 72)
@@ -0,0 +1,50 @@
+package org.openstreetmap.josm.tools;
+
+import java.util.HashMap;
+
+/**
+ * Helper class to use for xml outputting classes.
+ * 
+ * @author imi
+ */
+public class XmlWriter {
+
+	/**
+	 * Encode the given string in XML1.0 format.
+	 * Optimized to fast pass strings that don't need encoding (normal case).
+	 */
+	public static String encode(String unencoded) {
+		StringBuilder buffer = null;
+		for (int i = 0; i < unencoded.length(); ++i) {
+			String encS = XmlWriter.encoding.get(unencoded.charAt(i));
+			if (encS != null) {
+				if (buffer == null)
+					buffer = new StringBuilder(unencoded.substring(0,i));
+				buffer.append(encS);
+			} else if (buffer != null)
+				buffer.append(unencoded.charAt(i));
+		}
+		return (buffer == null) ? unencoded : buffer.toString();
+	}
+
+	/**
+	 * @return The standard XML1.0 header. Encoding is utf-8
+	 */
+	public static Object header() {
+		return "<?xml version='1.0' encoding='UTF-8'?>";
+	}
+
+	
+	
+	final private static HashMap<Character, String> encoding = new HashMap<Character, String>();
+	static {
+		encoding.put('<', "&lt;");
+		encoding.put('>', "&gt;");
+		encoding.put('"', "&quot;");
+		encoding.put('\'', "&apos;");
+		encoding.put('&', "&amp;");
+		encoding.put('\n', "&#xA;");
+		encoding.put('\r', "&#xD;");
+		encoding.put('\t', "&#x9;");
+	}
+}
