Index: code/branches/core2/src/orxonox/core/BaseObject.h
===================================================================
--- code/branches/core2/src/orxonox/core/BaseObject.h	(revision 876)
+++ code/branches/core2/src/orxonox/core/BaseObject.h	(revision 877)
@@ -79,4 +79,7 @@
             const std::string& getLevelfile() const;
 
+            inline void setNamespace(Namespace* ns) { this->namespace_ = ns; }
+            inline Namespace* getNamespace() const { return this->namespace_; }
+
             /** @brief Sets the indentation of the debug output in the Loader. @param indentation The indentation */
             inline void setLoaderIndentation(const std::string& indentation) { this->loaderIndentation_ = indentation; }
@@ -90,4 +93,5 @@
             const Level* level_;                        //!< The level that loaded this object
             std::string loaderIndentation_;             //!< Indentation of the debug output in the Loader
+            Namespace* namespace_;
     };
 }
Index: code/branches/core2/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/core2/src/orxonox/core/CMakeLists.txt	(revision 876)
+++ code/branches/core2/src/orxonox/core/CMakeLists.txt	(revision 877)
@@ -17,4 +17,5 @@
   Executor.cc
   XMLPort.cc
+  Namespace.cc
 )
 
Index: code/branches/core2/src/orxonox/core/CorePrereqs.h
===================================================================
--- code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 876)
+++ code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 877)
@@ -95,4 +95,5 @@
   template <class T>
   class MetaObjectListElement;
+  class Namespace;
   template <class T>
   class ObjectList;
Index: code/branches/core2/src/orxonox/core/Loader.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Loader.cc	(revision 876)
+++ code/branches/core2/src/orxonox/core/Loader.cc	(revision 877)
@@ -115,5 +115,5 @@
             xmlfile.LoadFile();
 
-            for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ )
+            for (ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++)
             {
                 Identifier* identifier = ID(child->Value());
Index: code/branches/core2/src/orxonox/core/Namespace.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Namespace.cc	(revision 877)
+++ code/branches/core2/src/orxonox/core/Namespace.cc	(revision 877)
@@ -0,0 +1,67 @@
+/*
+ *   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 "Namespace.h"
+#include "CoreIncludes.h"
+#include "XMLPort.h"
+
+namespace orxonox
+{
+    CreateFactory(Namespace);
+
+    Namespace::Namespace()
+    {
+        RegisterObject(Namespace);
+    }
+
+    Namespace::~Namespace()
+    {
+    }
+
+    /**
+        @brief XML loading and saving.
+        @param xmlelement The XML-element
+        @param loading Loading (true) or saving (false)
+        @return The XML-element
+    */
+    void Namespace::XMLPort(Element& xmlelement, bool loading)
+    {
+        BaseObject::XMLPort(xmlelement, loading);
+
+        XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, loading);
+    }
+
+    void Namespace::loadObjects(BaseObject* object)
+    {
+        object->setNamespace(this);
+    }
+
+    const BaseObject* Namespace::saveObjects(unsigned int index) const
+    {
+        return 0; // todo
+    }
+}
Index: code/branches/core2/src/orxonox/core/Namespace.h
===================================================================
--- code/branches/core2/src/orxonox/core/Namespace.h	(revision 877)
+++ code/branches/core2/src/orxonox/core/Namespace.h	(revision 877)
@@ -0,0 +1,56 @@
+/*
+ *   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 _Namespace_H__
+#define _Namespace_H__
+
+#include <list>
+
+#include "BaseObject.h"
+#include "util/XMLIncludes.h"
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class Namespace : public BaseObject
+    {
+        public:
+            Namespace();
+            virtual ~Namespace();
+
+            virtual void XMLPort(Element& xmlelement, bool loading);
+
+            void loadObjects(BaseObject* object);
+            const BaseObject* saveObjects(unsigned int index) const;
+
+        private:
+            std::list<Namespace*> namespaces_;
+    };
+}
+
+#endif /* _Namespace_H__ */
Index: code/branches/core2/src/orxonox/core/XMLPort.h
===================================================================
--- code/branches/core2/src/orxonox/core/XMLPort.h	(revision 876)
+++ code/branches/core2/src/orxonox/core/XMLPort.h	(revision 877)
@@ -211,5 +211,5 @@
     {
         public:
-            XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int))
+            XMLPortClassObjectContainer(const std::string classname, const std::string sectionname, void (T::*loadfunction)(O*), const O* (T::*savefunction)(unsigned int) const)
             {
                 this->classname_ = classname;
@@ -225,9 +225,13 @@
                     try
                     {
-                        Element* xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
+                        Element* xmlsubelement;
+                        if (this->sectionname_ != "")
+                            xmlsubelement = xmlelement.FirstChildElement(this->sectionname_, false);
+                        else
+                            xmlsubelement = &xmlelement;
 
                         if (xmlsubelement)
                         {
-                            for ( ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++ )
+                            for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
                             {
                                 Identifier* identifier = ID(child->Value());
@@ -276,5 +280,5 @@
         private:
             void     (T::*loadfunction_)(O*);
-            const O* (T::*savefunction_)(unsigned int);
+            const O* (T::*savefunction_)(unsigned int) const;
     };
 }
Index: code/branches/core2/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/branches/core2/src/orxonox/objects/WorldEntity.cc	(revision 876)
+++ code/branches/core2/src/orxonox/objects/WorldEntity.cc	(revision 877)
@@ -218,5 +218,5 @@
     }
 
-    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index)
+    const WorldEntity* WorldEntity::getAttachedWorldEntity(unsigned int index) const
     {
         if (index < this->attachedWorldEntities_.size())
Index: code/branches/core2/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/branches/core2/src/orxonox/objects/WorldEntity.h	(revision 876)
+++ code/branches/core2/src/orxonox/objects/WorldEntity.h	(revision 877)
@@ -29,5 +29,5 @@
 
             void attachWorldEntity(WorldEntity* entity);
-            const WorldEntity* getAttachedWorldEntity(unsigned int index);
+            const WorldEntity* getAttachedWorldEntity(unsigned int index) const;
 
             inline Ogre::SceneNode* getNode()
