Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java	(revision 17983)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxExtensionCollection.java	(revision 17984)
@@ -10,6 +10,6 @@
 import java.util.stream.Stream;
 
-import org.apache.commons.jcs3.access.exception.InvalidArgumentException;
 import org.openstreetmap.josm.io.GpxReader;
+import org.openstreetmap.josm.tools.Logging;
 import org.xml.sax.Attributes;
 
@@ -61,18 +61,19 @@
     /**
      * Sets the value for the last child and pops it from the stack, so the next one will be added to its parent.
-     * The qualified name is verified.
+     * A warning is issued if the qualified name does not equal the currently opened child.
      * @param qName the qualified name
      * @param value the value
      */
     public void closeChild(String qName, String value) {
-        if (childStack == null || childStack.isEmpty())
-            throw new InvalidArgumentException("Can't close child " + qName + ", no element in stack.");
+        if (childStack == null || childStack.isEmpty()) {
+            Logging.warn("Can''t close child ''{0}'', no element in stack.", qName);
+            return;
+		}
 
         GpxExtension child = childStack.pop();
-
         String childQN = child.getQualifiedName();
 
         if (!childQN.equals(qName))
-            throw new InvalidArgumentException("Can't close child " + qName + ", must close " + childQN + " first.");
+            Logging.warn("Couldn''t close child ''{0}'', closed ''{1}'' instead.", qName, childQN);
 
         child.setValue(value);
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 17983)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 17984)
@@ -84,5 +84,5 @@
         private GpxExtensionCollection currentTrackExtensionCollection;
         private Stack<State> states;
-        private final Stack<String> elements = new Stack<>();
+        private final Stack<String[]> elements = new Stack<>();
 
         private StringBuilder accumulator = new StringBuilder();
@@ -133,5 +133,5 @@
         @Override
         public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
-            elements.push(localName);
+            elements.push(new String[] { namespaceURI, localName, qName });
             switch(currentState) {
             case INIT:
@@ -610,7 +610,8 @@
 
         void tryToFinish() throws SAXException {
-            List<String> remainingElements = new ArrayList<>(elements);
+            List<String[]> remainingElements = new ArrayList<>(elements);
             for (int i = remainingElements.size() - 1; i >= 0; i--) {
-                endElement(null, remainingElements.get(i), remainingElements.get(i));
+                String[] e = remainingElements.get(i);
+                endElement(e[0], e[1], e[2]);
             }
             endDocument();
