Index: trunk/src/org/openstreetmap/josm/io/OsmWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 12691)
+++ trunk/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 12692)
@@ -205,4 +205,11 @@
     }
 
+    void writeLatLon(LatLon ll) {
+        if (ll != null) {
+            out.print(" lat='"+LatLon.cDdHighPecisionFormatter.format(ll.lat())+
+                     "' lon='"+LatLon.cDdHighPecisionFormatter.format(ll.lon())+'\'');
+        }
+    }
+
     @Override
     public void visit(INode n) {
@@ -212,8 +219,5 @@
             out.println("/>");
         } else {
-            if (n.getCoor() != null) {
-                out.print(" lat='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lat())+
-                          "' lon='"+LatLon.cDdHighPecisionFormatter.format(n.getCoor().lon())+'\'');
-            }
+            writeLatLon(n.getCoor());
             addTags(n, "node", true);
         }
Index: trunk/src/org/openstreetmap/josm/io/ValidatorErrorWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ValidatorErrorWriter.java	(revision 12691)
+++ trunk/src/org/openstreetmap/josm/io/ValidatorErrorWriter.java	(revision 12692)
@@ -65,6 +65,6 @@
         String timestamp = DateUtils.fromDate(new Date());
 
-        out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        out.println("<analysers generator='JOSM' timestamp=\""+timestamp+"\">");
+        out.println("<?xml version='1.0' encoding='UTF-8'?>");
+        out.println("<analysers generator='JOSM' timestamp='"+timestamp+"'>");
 
         OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(out, true, OsmChangeBuilder.DEFAULT_API_VERSION);
@@ -72,5 +72,5 @@
 
         for (Test test : analysers) {
-            out.println("  <analyser timestamp=\""+timestamp+"\" name=\""+test.getName()+"\">");
+            out.println("  <analyser timestamp='"+timestamp+"' name='"+XmlWriter.encode(test.getName())+"'>");
             // Build map of test error classes for the current test
             Map<ErrorClass, List<TestError>> map = new HashMap<>();
@@ -89,6 +89,6 @@
             // Write classes
             for (ErrorClass ec : map.keySet()) {
-                out.println("    <class id=\""+ec.id+"\" level=\""+ec.severity.getLevel()+"\">");
-                out.println("      <classtext lang=\""+lang+"\" title=\""+ec.message+"\"/>");
+                out.println("    <class id='"+ec.id+"' level='"+ec.severity.getLevel()+"'>");
+                out.println("      <classtext lang='"+XmlWriter.encode(lang)+"' title='"+XmlWriter.encode(ec.message)+"'/>");
                 out.println("    </class>");
             }
@@ -98,10 +98,12 @@
                 for (TestError error : entry.getValue()) {
                     LatLon ll = error.getPrimitives().iterator().next().getBBox().getCenter();
-                    out.println("    <error class=\""+entry.getKey().id+"\">");
-                    out.println("      <location lat=\""+ll.lat()+"\" lon=\""+ll.lon()+"\">");
+                    out.println("    <error class='"+entry.getKey().id+"'>");
+                    out.print("      <location");
+                    osmWriter.writeLatLon(ll);
+                    out.println(">");
                     for (OsmPrimitive p : error.getPrimitives()) {
                         p.accept(osmWriter);
                     }
-                    out.println("      <text lang=\""+lang+"\" value=\""+error.getDescription()+"\">");
+                    out.println("      <text lang='"+XmlWriter.encode(lang)+"' value='"+XmlWriter.encode(error.getDescription())+"'>");
                     if (error.isFixable()) {
                         out.println("      <fixes>");
