Index: /applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java
===================================================================
--- /applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java	(revision 33275)
+++ /applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java	(revision 33276)
@@ -18,4 +18,5 @@
 import java.awt.Color;
 import java.awt.Graphics;
+import java.util.Collection;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -63,6 +64,4 @@
         patternColors.put(Pattern.compile(TAG_ATTRIBUTE_PATTERN), new Color(
                 127, 0, 127));
-        patternColors.put(Pattern.compile(TAG_END_PATTERN), new Color(63, 127,
-                127));
         patternColors.put(Pattern.compile(TAG_ATTRIBUTE_VALUE), new Color(42,
                 0, 255));
@@ -104,4 +103,15 @@
             }
         }
+        /* Fix end tag duplication for CDATA and comments */
+        Matcher matcher = Pattern.compile(TAG_END_PATTERN).matcher(text);
+        Color c = new Color(63, 127, 127);
+        Collection<Integer> ends = startMap.values();
+
+        while (matcher.find()) {
+            if(!ends.contains(matcher.end())) {
+                startMap.put(matcher.start(1), matcher.end());
+                colorMap.put(matcher.start(1), c);
+            }
+        }
 
         // TODO: check the map for overlapping parts
