Index: /code/branches/usability/src/libraries/core/Loader.cc
===================================================================
--- /code/branches/usability/src/libraries/core/Loader.cc	(revision 7962)
+++ /code/branches/usability/src/libraries/core/Loader.cc	(revision 7963)
@@ -147,5 +147,5 @@
         Returns true if successful.
     */
-    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose)
+    bool Loader::load(const XMLFile* file, const ClassTreeMask& mask, bool verbose, bool bRemoveLuaTags)
     {
         if (!file)
@@ -155,5 +155,5 @@
 
         std::string xmlInput;
-        if (file->getLuaSupport())
+        if (file->getLuaSupport() && !bRemoveLuaTags)
         {
             // Use the LuaState to replace the XML tags (calls our function)
@@ -172,4 +172,13 @@
             }
             xmlInput = Resource::open(file->getFilename())->getAsString();
+
+            if (bRemoveLuaTags)
+            {
+                // Remove all Lua code.
+                // Note: we only need this to speed up parsing of level files at the
+                // start of the program.
+                // Assumption: the LevelInfo tag does not use Lua scripting
+                xmlInput = removeLuaTags(xmlInput);
+            }
         }
 
@@ -271,8 +280,7 @@
     }
 
-    std::string Loader::replaceLuaTags(const std::string& text)
-    {
-        // create map with all Lua tags
-        std::map<size_t, bool> luaTags;
+    bool Loader::getLuaTags(const std::string& text, std::map<size_t, bool>& luaTags)
+    {
+        // fill map with all Lua tags
         {
             size_t pos = 0;
@@ -328,8 +336,18 @@
             {
                 COUT(2) << "Warning: Error in level file" << std::endl;
-                // todo: errorhandling
-                return "";
-            }
-        }
+                // TODO: error handling
+                return false; 
+            }
+        }
+
+        return true;
+    }
+
+    std::string Loader::replaceLuaTags(const std::string& text)
+    {
+        // create a map with all lua tags
+        std::map<size_t, bool> luaTags;
+        if (!getLuaTags(text, luaTags))
+            return "";
 
         // Use a stringstream object to speed up the parsing
@@ -421,3 +439,41 @@
         return output.str();
     }
+
+    std::string Loader::removeLuaTags(const std::string& text)
+    {
+        // create a map with all lua tags
+        std::map<size_t, bool> luaTags;
+        if (!getLuaTags(text, luaTags))
+            return "";
+
+        // Use a stringstream object to speed up the concatenation
+        std::ostringstream output;
+
+        // cut the original string into pieces and only write the non Lua parts
+        std::map<size_t, bool>::iterator it = luaTags.begin();
+        bool bLuaCode = false;
+        size_t start = 0;
+        size_t end = 0;
+
+        do
+        {
+            if (it != luaTags.end())
+                end = (it++)->first;
+            else
+                end = std::string::npos;
+
+            if (!bLuaCode)
+            {
+                output << text.substr(start, end - start);
+                start = end + 5;
+            }
+            else
+                start = end + 2;
+
+            bLuaCode = !bLuaCode;
+        }
+        while (end != std::string::npos);
+
+        return output.str();
+    }
 }
Index: /code/branches/usability/src/libraries/core/Loader.h
===================================================================
--- /code/branches/usability/src/libraries/core/Loader.h	(revision 7962)
+++ /code/branches/usability/src/libraries/core/Loader.h	(revision 7963)
@@ -42,4 +42,5 @@
 #include "CorePrereqs.h"
 
+#include <map>
 #include <vector>
 #include "ClassTreeMask.h"
@@ -61,13 +62,17 @@
             static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
 
-            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
+            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
+                             bool verbose = true, bool bRemoveLuaTags = false);
             static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
             static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool verbose = true);
 
             static std::string replaceLuaTags(const std::string& text);
+            static std::string removeLuaTags(const std::string& text);
 
             static ClassTreeMask currentMask_s;
 
         private:
+            static bool getLuaTags(const std::string& text, std::map<size_t, bool>& luaTags);
+
             static std::vector<std::pair<const XMLFile*, ClassTreeMask> > files_s;
     };
Index: /code/branches/usability/src/orxonox/LevelManager.cc
===================================================================
--- /code/branches/usability/src/orxonox/LevelManager.cc	(revision 7962)
+++ /code/branches/usability/src/orxonox/LevelManager.cc	(revision 7963)
@@ -253,5 +253,5 @@
                 mask.exclude(ClassIdentifier<BaseObject>::getIdentifier());
                 mask.include(ClassIdentifier<LevelInfo>::getIdentifier());
-                Loader::load(&file, mask, false);
+                Loader::load(&file, mask, false, true);
                 // Iterate over all LevelInfos.
                 for(ObjectList<LevelInfo>::iterator item = ObjectList<LevelInfo>::begin(); item != ObjectList<LevelInfo>::end(); ++item)
