diff -ur doxygen-old/src/eclipsehelp.cpp doxygen-new/src/eclipsehelp.cpp
--- doxygen-old/src/eclipsehelp.cpp	2012-11-24 11:07:32.000000000 +0100
+++ doxygen-new/src/eclipsehelp.cpp	2012-11-24 11:07:15.000000000 +0100
@@ -18,7 +18,7 @@
 #include "message.h"
 #include "doxygen.h"
 
-EclipseHelp::EclipseHelp() : m_depth(0), m_endtag(FALSE), m_tocfile(0) 
+EclipseHelp::EclipseHelp() : m_depth(0), m_endtag(FALSE), m_openTags(0), m_tocfile(0) 
 {
 }
 
@@ -50,6 +50,7 @@
   {
     m_tocstream << ">" << endl;
     m_endtag = FALSE;
+    ++m_openTags;
   }
 }
 
@@ -143,8 +144,13 @@
   // -- end of the opened topic
   closedTag();
   --m_depth;
-  indent();
-  m_tocstream << "</topic>" << endl;
+
+  if (m_openTags==m_depth)
+  {
+    --m_openTags;
+    indent();
+    m_tocstream << "</topic>" << endl;
+  }
 }
 
 /*!
@@ -171,19 +177,41 @@
 {
   // -- write the topic tag 
   closedTag();
-  indent();
-  m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
   if (file) 
   { 
-    m_tocstream << " href=\"" << convertToXML(m_pathprefix) 
-                << file << Doxygen::htmlFileExtension;
-    if (anchor)
+    switch (file[0]) // check for special markers (user defined URLs)
     {
-      m_tocstream << "#" << anchor;
+      case '^':
+        // URL not supported by eclipse toc.xml
+	break;
+
+      case '!':
+        indent();
+        m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
+        m_tocstream << " href=\"" << convertToXML(m_pathprefix) << &file[1] << "\"";
+        m_endtag = TRUE;
+	break;
+
+      default:
+        indent();
+        m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
+        m_tocstream << " href=\"" << convertToXML(m_pathprefix) 
+                    << file << Doxygen::htmlFileExtension;
+        if (anchor)
+        {
+          m_tocstream << "#" << anchor;
+        }
+        m_tocstream << "\"";
+        m_endtag = TRUE;
+	break;
     }
-    m_tocstream << "\"";
   }
-  m_endtag = TRUE;
+  else
+  {
+    indent();
+    m_tocstream << "<topic label=\"" << convertToXML(name) << "\"";
+    m_endtag = TRUE;
+  }
 }
 
 void EclipseHelp::addIndexItem(
diff -ur doxygen-old/src/eclipsehelp.h doxygen-new/src/eclipsehelp.h
--- doxygen-old/src/eclipsehelp.h	2012-11-24 11:07:32.000000000 +0100
+++ doxygen-new/src/eclipsehelp.h	2012-11-24 11:07:15.000000000 +0100
@@ -61,6 +61,7 @@
   private:
     int m_depth;
     bool m_endtag;
+    int m_openTags;
 
     QFile * m_tocfile;
     FTextStream m_tocstream;
