Index: code/branches/core/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/core/src/orxonox/Orxonox.cc	(revision 818)
+++ code/branches/core/src/orxonox/Orxonox.cc	(revision 820)
@@ -84,4 +84,5 @@
 #include "objects/test2.h"
 #include "objects/test3.h"
+#include "core/Loader.h"
 
 #include "Orxonox.h"
@@ -849,5 +850,5 @@
         std::cout << "2\n";
 */
-
+/*
         std::cout << "Test 13\n";
 
@@ -1110,4 +1111,5 @@
 
         std::cout << "13\n";
+*/
 /*
         std::cout << "Test 14\n";
@@ -1134,4 +1136,13 @@
         std::cout << "2\n";
 */
+
+        std::cout << "Test 15\n";
+        std::cout << "1\n";
+
+        Level* test15_1 = new Level("levels/sample.oxw");
+        Loader::open(test15_1);
+
+        std::cout << "2\n";
+
 //    startRenderLoop();
   }
Index: code/branches/core/src/orxonox/core/BaseObject.cc
===================================================================
--- code/branches/core/src/orxonox/core/BaseObject.cc	(revision 818)
+++ code/branches/core/src/orxonox/core/BaseObject.cc	(revision 820)
@@ -45,4 +45,6 @@
     {
         RegisterRootObject(BaseObject);
+
+        this->level_ = 0;
     }
 
Index: code/branches/core/src/orxonox/core/BaseObject.h
===================================================================
--- code/branches/core/src/orxonox/core/BaseObject.h	(revision 818)
+++ code/branches/core/src/orxonox/core/BaseObject.h	(revision 820)
@@ -50,4 +50,10 @@
             virtual ~BaseObject();
             virtual void loadParams(TiXmlElement* xmlElem);
+
+            /** @brief Returns a pointer to the level that loaded this object. @return The level */
+            inline const Level* getLevel() const { return this->level_; }
+
+        private:
+            const Level* level_;                        //!< The level that loaded this object
     };
     ExportClass(BaseObject, Core);
Index: code/branches/core/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/core/src/orxonox/core/CMakeLists.txt	(revision 818)
+++ code/branches/core/src/orxonox/core/CMakeLists.txt	(revision 820)
@@ -14,5 +14,5 @@
   Language.cc
   ClassTreeMask.cc
-#  Level.cc
+  Loader.cc
 )
 
Index: code/branches/core/src/orxonox/core/ConfigValueContainer.cc
===================================================================
--- code/branches/core/src/orxonox/core/ConfigValueContainer.cc	(revision 818)
+++ code/branches/core/src/orxonox/core/ConfigValueContainer.cc	(revision 820)
@@ -876,5 +876,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in ConfigValueContainer:" << std::endl;
+            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
             COUT(1) << "Error: Couldn't open config-file " << filename << " to read the config values!" << std::endl;
             return;
@@ -923,5 +923,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in ConfigValueContainer:" << std::endl;
+            COUT(1) << "An error occurred in ConfigValueContainer.cc:" << std::endl;
             COUT(1) << "Error: Couldn't open config-file " << filename << " to write the config values!" << std::endl;
             return;
Index: code/branches/core/src/orxonox/core/CoreIncludes.h
===================================================================
--- code/branches/core/src/orxonox/core/CoreIncludes.h	(revision 818)
+++ code/branches/core/src/orxonox/core/CoreIncludes.h	(revision 820)
@@ -79,5 +79,5 @@
 */
 #define RegisterObject(ClassName) \
-    COUT(4) << "*** Register Object: " << #ClassName << std::endl; \
+    COUT(5) << "*** Register Object: " << #ClassName << std::endl; \
     InternRegisterObject(ClassName, false)
 
@@ -87,5 +87,5 @@
 */
 #define RegisterRootObject(ClassName) \
-    COUT(4) << "*** Register Root-Object: " << #ClassName << std::endl; \
+    COUT(5) << "*** Register Root-Object: " << #ClassName << std::endl; \
     InternRegisterRootObject(ClassName)
 
Index: code/branches/core/src/orxonox/core/CorePrereqs.h
===================================================================
--- code/branches/core/src/orxonox/core/CorePrereqs.h	(revision 818)
+++ code/branches/core/src/orxonox/core/CorePrereqs.h	(revision 820)
@@ -81,6 +81,4 @@
   class Identifier;
   class IdentifierDistributor;
-//  class IdentifierList;
-//  class IdentifierListElement;
   template <class T>
   class Iterator;
@@ -88,4 +86,5 @@
   class LanguageEntry;
   class Level;
+  class Loader;
   class MetaObjectList;
   template <class T>
Index: code/branches/core/src/orxonox/core/Identifier.cc
===================================================================
--- code/branches/core/src/orxonox/core/Identifier.cc	(revision 818)
+++ code/branches/core/src/orxonox/core/Identifier.cc	(revision 820)
@@ -125,5 +125,5 @@
         else
         {
-            COUT(1) << "An error occurred in Identifier:" << std::endl;
+            COUT(1) << "An error occurred in Identifier.cc:" << std::endl;
             COUT(1) << "Error: Cannot fabricate an object of type '" << this->name_ << "'. Class has no factory." << std::endl;
             COUT(1) << "Aborting..." << std::endl;
Index: code/branches/core/src/orxonox/core/Identifier.h
===================================================================
--- code/branches/core/src/orxonox/core/Identifier.h	(revision 818)
+++ code/branches/core/src/orxonox/core/Identifier.h	(revision 820)
@@ -266,5 +266,5 @@
     ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass)
     {
-        COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
+        COUT(5) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
 
         // Check if at least one object of the given type was created
@@ -305,5 +305,5 @@
     void ClassIdentifier<T>::addObject(T* object)
     {
-        COUT(4) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
+        COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
         object->getMetaList().add(this->objects_, this->objects_->add(object));
     }
@@ -359,5 +359,5 @@
                 if (!identifier->isA(ClassManager<T>::getIdentifier()))
                 {
-                    COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
+                    COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
                     COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
                     COUT(1) << "Error: SubclassIdentifier<" << ClassManager<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
@@ -406,5 +406,5 @@
                     if (this->identifier_)
                     {
-                        COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
+                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
                         COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl;
                         COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
@@ -413,5 +413,5 @@
                     else
                     {
-                        COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl;
+                        COUT(1) << "An error occurred in SubclassIdentifier (Identifier.h):" << std::endl;
                         COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl;
                         COUT(1) << "Aborting..." << std::endl;
Index: code/branches/core/src/orxonox/core/Language.cc
===================================================================
--- code/branches/core/src/orxonox/core/Language.cc	(revision 818)
+++ code/branches/core/src/orxonox/core/Language.cc	(revision 820)
@@ -230,5 +230,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language:" << std::endl;
+            COUT(1) << "An error occurred in Language.cc:" << std::endl;
             COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to read the default language entries!" << std::endl;
             return;
@@ -272,5 +272,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language:" << std::endl;
+            COUT(1) << "An error occurred in Language.cc:" << std::endl;
             COUT(1) << "Error: Couldn't open file " << getFileName(this->language_) << " to read the translated language entries!" << std::endl;
             ResetConfigValue(language_);
@@ -324,5 +324,5 @@
         if (!file.is_open())
         {
-            COUT(1) << "An error occurred in Language:" << std::endl;
+            COUT(1) << "An error occurred in Language.cc:" << std::endl;
             COUT(1) << "Error: Couldn't open file " << getFileName(this->defaultLanguage_) << " to write the default language entries!" << std::endl;
             return;
Index: code/branches/core/src/orxonox/core/Level.h
===================================================================
--- code/branches/core/src/orxonox/core/Level.h	(revision 820)
+++ code/branches/core/src/orxonox/core/Level.h	(revision 820)
@@ -0,0 +1,54 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Level_H__
+#define _Level_H__
+
+#include <string>
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class _CoreExport Level
+    {
+        public:
+            Level(const std::string& file) : file_(file) {}
+            Level(const std::string& file, const ClassTreeMask& mask) : file_(file), mask_(mask) {};
+
+            const std::string& getFile() const { return this->file_; }
+            const ClassTreeMask& getMask() const { return this->mask_; }
+
+            void setMask(const ClassTreeMask& mask) { this->mask_ = mask; }
+
+        private:
+            std::string file_;
+            ClassTreeMask mask_;
+    };
+}
+
+#endif
Index: code/branches/core/src/orxonox/core/Loader.cc
===================================================================
--- code/branches/core/src/orxonox/core/Loader.cc	(revision 820)
+++ code/branches/core/src/orxonox/core/Loader.cc	(revision 820)
@@ -0,0 +1,159 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Loader.h"
+#include "Level.h"
+#include "BaseObject.h"
+#include "Identifier.h"
+#include "Iterator.h"
+#include "Debug.h"
+
+//#define TIXML_USE_TICPP
+#include "util/tinyxml/ticpp.h"
+
+namespace orxonox
+{
+    std::vector<std::pair<const Level*, ClassTreeMask> > Loader::levels_s;
+
+    bool Loader::open(const Level* level, const ClassTreeMask& mask)
+    {
+        Loader::add(level, mask);
+        return Loader::load(level, mask);
+    }
+
+    void Loader::close()
+    {
+        Loader::unload();
+        Loader::levels_s.clear();
+    }
+
+    void Loader::close(const Level* level)
+    {
+        Loader::unload(level);
+        Loader::remove(level);
+    }
+
+    void Loader::add(const Level* level, const ClassTreeMask& mask)
+    {
+        Loader::levels_s.insert(Loader::levels_s.end(), std::pair<const Level*, ClassTreeMask>(level, mask));
+    }
+
+    void Loader::remove(const Level* level)
+    {
+        for (std::vector<std::pair<const Level*, ClassTreeMask> >::iterator it = Loader::levels_s.begin(); it != Loader::levels_s.end(); ++it)
+        {
+            if ((*it).first == level)
+            {
+                Loader::levels_s.erase(it);
+                break;
+            }
+        }
+    }
+
+    bool Loader::load(const ClassTreeMask& mask)
+    {
+        bool success = true;
+        for (std::vector<std::pair<const Level*, ClassTreeMask> >::iterator it = Loader::levels_s.begin(); it != Loader::levels_s.end(); ++it)
+            if (!Loader::load((*it).first, (*it).second * mask))
+                success = false;
+
+        return success;
+    }
+
+    void Loader::unload(const ClassTreeMask& mask)
+    {
+        for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; )
+        {
+            if (mask.isIncluded(it->getIdentifier()))
+                delete (*(it++));
+            else
+                ++it;
+        }
+    }
+
+    bool Loader::reload(const ClassTreeMask& mask)
+    {
+        Loader::unload(mask);
+        return Loader::load(mask);
+    }
+
+    bool Loader::load(const Level* level, const ClassTreeMask& mask)
+    {
+        ClassTreeMask loadmask = level->getMask() * mask;
+
+        try
+        {
+            COUT(0) << "Start loading " << level->getFile() << "..." << std::endl;
+            COUT(3) << "Mask: " << loadmask << std::endl;
+
+            ticpp::Document xmlfile(level->getFile());
+            xmlfile.LoadFile();
+
+            for ( ticpp::Iterator< ticpp::Element > child = xmlfile.FirstChildElement(); child != child.end(); child++ )
+            {
+                Identifier* identifier = ID(child->Value());
+                if (identifier)
+                {
+                    COUT(4) << "  fabricating " << child->Value() << "..." << std::endl;
+                    BaseObject* newObject = identifier->fabricate();
+                }
+                else
+                {
+                    COUT(2) << "  Warning: '"<< child->Value() <<"' is not a valid classname." << std::endl;
+                }
+            }
+
+            COUT(0) << "Finished loading " << level->getFile() << "." << std::endl;
+
+            return true;
+        }
+        catch(ticpp::Exception& ex)
+        {
+            COUT(1) << "An error occurred in Loader.cc while loading " << level->getFile() << ":" << std::endl;
+            COUT(1) << ex.what() << std::endl;
+            COUT(1) << "Loading aborted." << std::endl;
+            return false;
+        }
+    }
+
+    void Loader::unload(const Level* level, const ClassTreeMask& mask)
+    {
+        for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; )
+        {
+            if ((it->getLevel() == level) && mask.isIncluded(it->getIdentifier()))
+                delete (*(it++));
+            else
+                ++it;
+        }
+    }
+
+    bool Loader::reload(const Level* level, const ClassTreeMask& mask)
+    {
+        Loader::unload(level, mask);
+        return Loader::load(level, mask);
+    }
+}
Index: code/branches/core/src/orxonox/core/Loader.h
===================================================================
--- code/branches/core/src/orxonox/core/Loader.h	(revision 820)
+++ code/branches/core/src/orxonox/core/Loader.h	(revision 820)
@@ -0,0 +1,63 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Loader_H__
+#define _Loader_H__
+
+#include <vector>
+
+#include "ClassTreeMask.h"
+#include "Level.h"
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class _CoreExport Loader
+    {
+        public:
+            static bool open(const Level* level, const ClassTreeMask& mask = ClassTreeMask());
+            static void close();
+            static void close(const Level* level);
+
+            static void add(const Level* level, const ClassTreeMask& mask = ClassTreeMask());
+            static void remove(const Level* level);
+
+            static bool load(const ClassTreeMask& mask = ClassTreeMask());
+            static void unload(const ClassTreeMask& mask = ClassTreeMask());
+            static bool reload(const ClassTreeMask& mask = ClassTreeMask());
+
+            static bool load(const Level* level, const ClassTreeMask& mask = ClassTreeMask());
+            static void unload(const Level* level, const ClassTreeMask& mask = ClassTreeMask());
+            static bool reload(const Level* level, const ClassTreeMask& mask = ClassTreeMask());
+
+        private:
+            static std::vector<std::pair<const Level*, ClassTreeMask> > levels_s;
+    };
+}
+
+#endif
Index: code/branches/core/src/orxonox/core/MetaObjectList.h
===================================================================
--- code/branches/core/src/orxonox/core/MetaObjectList.h	(revision 818)
+++ code/branches/core/src/orxonox/core/MetaObjectList.h	(revision 820)
@@ -99,5 +99,5 @@
 
 
-        COUT(4) << "*** MetaObjectList: Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
+        COUT(5) << "*** MetaObjectList: Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
         delete this->element_;
     }
Index: code/branches/core/src/util/CMakeLists.txt
===================================================================
--- code/branches/core/src/util/CMakeLists.txt	(revision 818)
+++ code/branches/core/src/util/CMakeLists.txt	(revision 820)
@@ -4,5 +4,4 @@
 
 SET (UTIL_SRC_FILES
-  ${TINYXML_SRC_FILES}
   Math.cc
   String.cc
@@ -11,4 +10,5 @@
   MultiTypeString.cc
   MultiTypeMath.cc
+  ${TINYXML_SRC_FILES}
 )
 
Index: code/branches/core/src/util/UtilPrereqs.h
===================================================================
--- code/branches/core/src/util/UtilPrereqs.h	(revision 818)
+++ code/branches/core/src/util/UtilPrereqs.h	(revision 820)
Index: code/branches/core/src/util/tinyxml/ticpp.cc
===================================================================
--- code/branches/core/src/util/tinyxml/ticpp.cc	(revision 818)
+++ code/branches/core/src/util/tinyxml/ticpp.cc	(revision 820)
@@ -1,2 +1,4 @@
+#define TIXML_USE_TICPP
+
 /*
 http://code.google.com/p/ticpp/
Index: code/branches/core/src/util/tinyxml/ticpp.h
===================================================================
--- code/branches/core/src/util/tinyxml/ticpp.h	(revision 818)
+++ code/branches/core/src/util/tinyxml/ticpp.h	(revision 820)
@@ -1,2 +1,4 @@
+#define TIXML_USE_TICPP
+
 /*
 http://code.google.com/p/ticpp/
Index: code/branches/core/src/util/tinyxml/ticpprc.h
===================================================================
--- code/branches/core/src/util/tinyxml/ticpprc.h	(revision 818)
+++ code/branches/core/src/util/tinyxml/ticpprc.h	(revision 820)
@@ -1,2 +1,4 @@
+#define TIXML_USE_TICPP
+
 /*
 http://code.google.com/p/ticpp/
Index: code/branches/core/src/util/tinyxml/tinyxml.h
===================================================================
--- code/branches/core/src/util/tinyxml/tinyxml.h	(revision 818)
+++ code/branches/core/src/util/tinyxml/tinyxml.h	(revision 820)
@@ -1,2 +1,4 @@
+#define TIXML_USE_TICPP
+
 /*
 www.sourceforge.net/projects/tinyxml
