Index: /code/branches/core2/src/orxonox/core/BaseObject.cc
===================================================================
--- /code/branches/core2/src/orxonox/core/BaseObject.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/core/BaseObject.cc	(revision 902)
@@ -79,7 +79,7 @@
         @return The XML-element
     */
-    void BaseObject::XMLPort(Element& xmlelement, bool loading)
+    void BaseObject::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, loading);
+        XMLPortParam(BaseObject, "name", setName, getName, xmlelement, mode);
     }
 
Index: /code/branches/core2/src/orxonox/core/BaseObject.h
===================================================================
--- /code/branches/core2/src/orxonox/core/BaseObject.h	(revision 901)
+++ /code/branches/core2/src/orxonox/core/BaseObject.h	(revision 902)
@@ -50,5 +50,5 @@
             virtual ~BaseObject();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
             /** @brief Sets the name of the object. @param name The name */
Index: /code/branches/core2/src/orxonox/core/CorePrereqs.h
===================================================================
--- /code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 901)
+++ /code/branches/core2/src/orxonox/core/CorePrereqs.h	(revision 902)
@@ -65,4 +65,16 @@
 namespace orxonox
 {
+#ifndef _XMLPort_Mode__
+#define _XMLPort_Mode__
+  namespace XMLPort
+  {
+    enum Mode
+    {
+      LoadObject,
+      SaveObject
+    };
+  }
+#endif
+
   typedef std::string LanguageEntryLabel;
 
Index: /code/branches/core2/src/orxonox/core/Loader.cc
===================================================================
--- /code/branches/core2/src/orxonox/core/Loader.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/core/Loader.cc	(revision 902)
@@ -129,5 +129,5 @@
             rootNamespace->setNamespace(rootNamespace);
             rootNamespace->setRoot(true);
-            rootNamespace->XMLPort(rootElement, true);
+            rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
 
             COUT(0) << "Finished loading " << level->getFile() << "." << std::endl;
Index: /code/branches/core2/src/orxonox/core/Namespace.cc
===================================================================
--- /code/branches/core2/src/orxonox/core/Namespace.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/core/Namespace.cc	(revision 902)
@@ -58,7 +58,7 @@
         @return The XML-element
     */
-    void Namespace::XMLPort(Element& xmlelement, bool loading)
+    void Namespace::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, loading);
+        BaseObject::XMLPort(xmlelement, mode);
 
         std::string name = this->getName();
@@ -89,6 +89,6 @@
         }
 
-        XMLPortParam(Namespace, "operator", setOperator, getOperator, xmlelement, loading);
-        XMLPortParam(Namespace, "bAutogenerated", setAutogenerated, isAutogenerated, xmlelement, loading);
+        XMLPortParam(Namespace, "operator", setOperator, getOperator, xmlelement, mode);
+        XMLPortParam(Namespace, "bAutogenerated", setAutogenerated, isAutogenerated, xmlelement, mode);
 
         if (this->bAutogeneratedFileRootNamespace_)
@@ -101,5 +101,5 @@
         }
 
-        XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, loading, true, false);
+        XMLPortObject(Namespace, BaseObject, "", loadObjects, saveObjects, xmlelement, mode, true, false);
     }
 
Index: /code/branches/core2/src/orxonox/core/Namespace.h
===================================================================
--- /code/branches/core2/src/orxonox/core/Namespace.h	(revision 901)
+++ /code/branches/core2/src/orxonox/core/Namespace.h	(revision 902)
@@ -44,5 +44,5 @@
             virtual ~Namespace();
 
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
 
             void loadObjects(BaseObject* object);
Index: /code/branches/core2/src/orxonox/core/XMLPort.h
===================================================================
--- /code/branches/core2/src/orxonox/core/XMLPort.h	(revision 901)
+++ /code/branches/core2/src/orxonox/core/XMLPort.h	(revision 902)
@@ -75,4 +75,17 @@
 namespace orxonox
 {
+
+#ifndef _XMLPort_Mode__
+#define _XMLPort_Mode__
+    namespace XMLPort
+    {
+        enum Mode
+        {
+            LoadObject,
+            SaveObject
+        };
+    }
+#endif
+
     // ###############################
     // ###  XMLPortParamContainer  ###
@@ -123,7 +136,7 @@
             }
 
-            XMLPortParamContainer& port(T* object, Element& xmlelement, bool loading)
-            {
-                if (loading)
+            XMLPortParamContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
+            {
+                if (mode == XMLPort::LoadObject)
                 {
                     try
@@ -227,7 +240,7 @@
             }
 
-            XMLPortObjectContainer& port(T* object, Element& xmlelement, bool loading)
-            {
-                if (loading)
+            XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode)
+            {
+                if (mode == XMLPort::LoadObject)
                 {
                     try
@@ -257,5 +270,5 @@
                                             if (this->bLoadBefore_)
                                             {
-                                                newObject->XMLPort(*child, true);
+                                                newObject->XMLPort(*child, XMLPort::LoadObject);
                                                 COUT(4) << object->getLoaderIndentation() << "assigning " << child->Value() << " (objectname " << newObject->getName() << ") to " << this->classname_ << " (objectname " << object->getName() << ")" << std::endl;
                                             }
@@ -266,5 +279,5 @@
                                             (*object.*this->loadfunction_)(newObject);
                                             if (!this->bLoadBefore_)
-                                                newObject->XMLPort(*child, true);
+                                                newObject->XMLPort(*child, XMLPort::LoadObject);
                                             COUT(5) << object->getLoaderIndentation() << "...fabricated " << child->Value() << " (objectname " << newObject->getName() << ")." << std::endl;
                                         }
Index: /code/branches/core2/src/orxonox/objects/Ambient.cc
===================================================================
--- /code/branches/core2/src/orxonox/objects/Ambient.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Ambient.cc	(revision 902)
@@ -85,9 +85,9 @@
         @return The XML-element
     */
-    void Ambient::XMLPort(Element& xmlelement, bool loading)
+    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, loading);
+        BaseObject::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, loading);
+        XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode);
     }
 }
Index: /code/branches/core2/src/orxonox/objects/Ambient.h
===================================================================
--- /code/branches/core2/src/orxonox/objects/Ambient.h	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Ambient.h	(revision 902)
@@ -15,5 +15,5 @@
 
             void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setAmbientLight(const ColourValue& colour);
 
Index: /code/branches/core2/src/orxonox/objects/Model.cc
===================================================================
--- /code/branches/core2/src/orxonox/objects/Model.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Model.cc	(revision 902)
@@ -67,9 +67,9 @@
         @return The XML-element
     */
-    void Model::XMLPort(Element& xmlelement, bool loading)
+    void Model::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        WorldEntity::XMLPort(xmlelement, loading);
+        WorldEntity::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, loading);
+        XMLPortParamLoadOnly(Model, "mesh", setMesh, xmlelement, mode);
 
         create();
Index: /code/branches/core2/src/orxonox/objects/Model.h
===================================================================
--- /code/branches/core2/src/orxonox/objects/Model.h	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Model.h	(revision 902)
@@ -18,5 +18,5 @@
             virtual ~Model();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setMesh(const std::string& meshname);
             bool create();
Index: /code/branches/core2/src/orxonox/objects/Skybox.cc
===================================================================
--- /code/branches/core2/src/orxonox/objects/Skybox.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Skybox.cc	(revision 902)
@@ -77,9 +77,9 @@
         @return The XML-element
     */
-    void Skybox::XMLPort(Element& xmlelement, bool loading)
+    void Skybox::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        BaseObject::XMLPort(xmlelement, loading);
+        BaseObject::XMLPort(xmlelement, mode);
 
-        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, loading);
+        XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, mode);
     }
 }
Index: /code/branches/core2/src/orxonox/objects/Skybox.h
===================================================================
--- /code/branches/core2/src/orxonox/objects/Skybox.h	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/Skybox.h	(revision 902)
@@ -17,5 +17,5 @@
 
             void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             void setSkybox(const std::string& skyboxname);
 
Index: /code/branches/core2/src/orxonox/objects/SpaceShip.cc
===================================================================
--- /code/branches/core2/src/orxonox/objects/SpaceShip.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/SpaceShip.cc	(revision 902)
@@ -291,16 +291,16 @@
         @return The XML-element
     */
-    void SpaceShip::XMLPort(Element& xmlelement, bool loading)
-    {
-        Model::XMLPort(xmlelement, loading);
-
-        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, loading);
-        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, loading);
+    void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        Model::XMLPort(xmlelement, mode);
+
+        XMLPortParamLoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);
+        XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);
     }
 
Index: /code/branches/core2/src/orxonox/objects/SpaceShip.h
===================================================================
--- /code/branches/core2/src/orxonox/objects/SpaceShip.h	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/SpaceShip.h	(revision 902)
@@ -24,5 +24,5 @@
             void setConfigValues();
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void tick(float dt);
 
Index: /code/branches/core2/src/orxonox/objects/WorldEntity.cc
===================================================================
--- /code/branches/core2/src/orxonox/objects/WorldEntity.cc	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/WorldEntity.cc	(revision 902)
@@ -171,16 +171,16 @@
         @return The XML-element
     */
-    void WorldEntity::XMLPort(Element& xmlelement, bool loading)
-    {
-        BaseObject::XMLPort(xmlelement, loading);
-
-        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, loading);
-        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, loading);
-        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, loading);
-        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, loading);
-        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, loading);
-        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading);
-
-        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, loading, false, true);
+    void WorldEntity::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        BaseObject::XMLPort(xmlelement, mode);
+
+        XMLPortParam(WorldEntity, "position", setPositionLoader2, getPosition, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "direction", setDirectionLoader, xmlelement, mode);
+        XMLPortParamLoadOnly(WorldEntity, "yawpitchroll", setYawPitchRoll, xmlelement, mode);
+        XMLPortParam(WorldEntity, "scale", setTotalScale, getScale, xmlelement, mode);
+        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxisLoader, getRotationAxis, xmlelement, mode);
+        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, mode);
+
+        XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true);
     }
 
Index: /code/branches/core2/src/orxonox/objects/WorldEntity.h
===================================================================
--- /code/branches/core2/src/orxonox/objects/WorldEntity.h	(revision 901)
+++ /code/branches/core2/src/orxonox/objects/WorldEntity.h	(revision 902)
@@ -25,5 +25,5 @@
             virtual void tick(float dt);
             virtual void loadParams(TiXmlElement* xmlElem);
-            virtual void XMLPort(Element& xmlelement, bool loading);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             bool create();
 
