Index: code/branches/core/src/orxonox/core/XMLPort.h
===================================================================
--- code/branches/core/src/orxonox/core/XMLPort.h	(revision 849)
+++ code/branches/core/src/orxonox/core/XMLPort.h	(revision 850)
@@ -31,5 +31,8 @@
 #include "util/XMLIncludes.h"
 #include "util/MultiTypeMath.h"
+#include "util/TinyXML/ticpp.h"
+#include "util/SubString.h"
 #include "Functor.h"
+#include "Debug.h"
 
 #include "CorePrereqs.h"
@@ -97,7 +100,28 @@
                 if (loading)
                 {
+                    std::string attribute = xmlelement.GetAttribute(this->paramname_);
+                    if (attribute.size() > 0)
+                    {
+                        SubString tokens(attribute, ",", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+                        if ((unsigned int)tokens.size() >= (unsigned int)this->loadfunction_->getParamCount())
+                        {
+                            MultiTypeMath param1, param2, param3, param4, param5;
+                            if (tokens.size() >= 1) param1 = tokens[0];
+                            if (tokens.size() >= 2) param1 = tokens[1];
+                            if (tokens.size() >= 3) param1 = tokens[2];
+                            if (tokens.size() >= 4) param1 = tokens[3];
+                            if (tokens.size() >= 5) param1 = tokens[4];
+
+                            (*this->loadfunction_)(object, param1, param2, param3, param4, param5);
+                        }
+                        else
+                        {
+                            COUT(2) << "  Warning: Parameter \"" << this->paramname_ << "\" in \"" << this->classname_ << "\" (objectname: " << object->getName() << ") is incomplete and couln't be loaded." << std::endl;
+                        }
+                    }
                 }
                 else
                 {
+//                    xmlelement.SetAttribute(this->paramname_, "...");
                 }
 
Index: code/branches/core/src/orxonox/objects/WorldEntity.cc
===================================================================
--- code/branches/core/src/orxonox/objects/WorldEntity.cc	(revision 849)
+++ code/branches/core/src/orxonox/objects/WorldEntity.cc	(revision 850)
@@ -37,4 +37,5 @@
 #include "../Orxonox.h"
 #include "WorldEntity.h"
+#include "core/XMLPort.h"
 
 namespace orxonox
@@ -86,6 +87,7 @@
     void WorldEntity::loadParams(TiXmlElement* xmlElem)
     {
+
         BaseObject::loadParams(xmlElem);
-
+/*
         if (xmlElem->Attribute("position"))
         {
@@ -153,5 +155,30 @@
 
         create();
-
+*/
+    }
+
+
+    /**
+        @brief XML loading and saving.
+        @param xmlelement The XML-element
+        @param loading Loading (true) or saving (false)
+        @return The XML-element
+    */
+    Element& WorldEntity::XMLPort(Element& xmlelement, bool loading)
+    {
+std::cout << "2_1: " << this->getPosition() << std::endl;
+        BaseObject::XMLPort(xmlelement, loading);
+
+        XMLPortParam(WorldEntity, "position", setPosition, getPosition, xmlelement, loading);
+//        XMLPortParam(WorldEntity, "direction", setDirection, getDirection, xmlelement, loading);
+//        XMLPortParam(WorldEntity, "yaw", yaw, getYaw, xmlelement, loading);
+//        XMLPortParam(WorldEntity, "pitch", pitch, getPitch, xmlelement, loading);
+//        XMLPortParam(WorldEntity, "roll", roll, getRoll, xmlelement, loading);
+        XMLPortParam(WorldEntity, "scale", setScale, getScale, xmlelement, loading);
+        XMLPortParam(WorldEntity, "rotationAxis", setRotationAxis, getRotationAxis, xmlelement, loading);
+        XMLPortParam(WorldEntity, "rotationRate", setRotationRate, getRotationRate, xmlelement, loading);
+std::cout << "2_2: " << this->getPosition() << std::endl;
+
+        return xmlelement;
     }
 
Index: code/branches/core/src/orxonox/objects/WorldEntity.h
===================================================================
--- code/branches/core/src/orxonox/objects/WorldEntity.h	(revision 849)
+++ code/branches/core/src/orxonox/objects/WorldEntity.h	(revision 850)
@@ -8,6 +8,7 @@
 
 #include "util/Math.h"
+#include "util/XMLIncludes.h"
 #include "network/Synchronisable.h"
-#include "util/tinyxml/tinyxml.h"
+//#include "util/tinyxml/tinyxml.h"
 #include "../core/CoreIncludes.h"
 #include "core/BaseObject.h"
@@ -17,134 +18,135 @@
 namespace orxonox
 {
-  class _OrxonoxExport WorldEntity : public BaseObject, public Tickable//, public network::Synchronisable
-  {
-    public:
-      WorldEntity();
-      virtual ~WorldEntity();
+    class _OrxonoxExport WorldEntity : public BaseObject, public Tickable//, public network::Synchronisable
+    {
+        public:
+            WorldEntity();
+            virtual ~WorldEntity();
 
-      virtual void tick(float dt);
-      virtual void loadParams(TiXmlElement* xmlElem);
-      bool create();
+            virtual void tick(float dt);
+            virtual void loadParams(TiXmlElement* xmlElem);
+            virtual Element& XMLPort(Element& xmlelement, bool loading);
+            bool create();
 
-      inline Ogre::SceneNode* getNode()
-          { return this->node_; }
+            inline Ogre::SceneNode* getNode()
+                { return this->node_; }
 
-      inline void setNode(Ogre::SceneNode* node)
-          { this->node_ = node; }
+            inline void setNode(Ogre::SceneNode* node)
+                { this->node_ = node; }
 
-      inline void setPosition(const Vector3& pos)
-          { this->node_->setPosition(pos); }
-      inline void setPosition(Real x, Real y, Real z)
-          { this->node_->setPosition(x, y, z); }
-      inline const Vector3& getPosition() const
-          { return this->node_->getPosition(); }
+            inline void setPosition(const Vector3& pos)
+                { this->node_->setPosition(pos); }
+//            inline void setPosition(Real x, Real y, Real z)
+//                { this->node_->setPosition(x, y, z); }
+            inline const Vector3& getPosition() const
+                { return this->node_->getPosition(); }
 
-      inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-          { this->node_->translate(d, relativeTo); }
-      inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-          { this->node_->translate(x, y, z, relativeTo); }
-      inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-          { this->node_->translate(axes, move, relativeTo); }
-      inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
-          { this->node_->translate(axes, x, y, z, relativeTo); }
+            inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+                { this->node_->translate(d, relativeTo); }
+            inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+                { this->node_->translate(x, y, z, relativeTo); }
+            inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+                { this->node_->translate(axes, move, relativeTo); }
+            inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
+                { this->node_->translate(axes, x, y, z, relativeTo); }
 
-      inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-          { this->node_->yaw(angle, relativeTo); }
-      inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-          { this->node_->pitch(angle, relativeTo); }
-      inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-          { this->node_->roll(angle, relativeTo); }
+            inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+                { this->node_->yaw(angle, relativeTo); }
+            inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+                { this->node_->pitch(angle, relativeTo); }
+            inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+                { this->node_->roll(angle, relativeTo); }
 
-      inline const Ogre::Quaternion& getOrientation()
-        { return this->node_->getOrientation(); }
-      inline void setOrientation(const Ogre::Quaternion& quat)
-        { this->node_->setOrientation(quat); }
-      inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
-        { this->node_->rotate(axis, angle, relativeTo); }
-      inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-        { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
-      inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-        { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
-      inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
-        { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
+            inline const Ogre::Quaternion& getOrientation()
+              { return this->node_->getOrientation(); }
+            inline void setOrientation(const Ogre::Quaternion& quat)
+              { this->node_->setOrientation(quat); }
+            inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
+              { this->node_->rotate(axis, angle, relativeTo); }
+            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+              { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
+            inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+              { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
+            inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
+              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
 
-      inline void setScale(const Vector3 &scale)
-        { this->node_->setScale(scale); }
-      inline void setScale(Real x, Real y, Real z)
-        { this->node_->setScale(x, y, z); }
-      inline void setScale(Real scale)
-        { this->node_->setScale(scale, scale, scale); }
-      inline const Vector3& getScale(void) const
-        { return this->node_->getScale(); }
-      inline void scale(const Vector3 &scale)
-        { this->node_->scale(scale); }
-      inline void scale(Real x, Real y, Real z)
-        { this->node_->scale(x, y, z); }
-      inline void scale(Real scale)
-        { this->node_->scale(scale, scale, scale); }
+            inline void setScale(const Vector3 &scale)
+              { this->node_->setScale(scale); }
+            inline void setScale(Real x, Real y, Real z)
+              { this->node_->setScale(x, y, z); }
+            inline void setScale(Real scale)
+              { this->node_->setScale(scale, scale, scale); }
+            inline const Vector3& getScale(void) const
+              { return this->node_->getScale(); }
+            inline void scale(const Vector3 &scale)
+              { this->node_->scale(scale); }
+            inline void scale(Real x, Real y, Real z)
+              { this->node_->scale(x, y, z); }
+            inline void scale(Real scale)
+              { this->node_->scale(scale, scale, scale); }
 
-      inline void attachObject(Ogre::MovableObject *obj)
-        { this->node_->attachObject(obj); }
-      inline void attachObject(Mesh &mesh)
-        { this->node_->attachObject(mesh.getEntity()); }
-      inline void detachObject(Ogre::MovableObject *obj)
-        { this->node_->detachObject(obj); }
-      inline void detachAllObjects()
-        { this->node_->detachAllObjects(); }
+            inline void attachObject(Ogre::MovableObject *obj)
+              { this->node_->attachObject(obj); }
+            inline void attachObject(Mesh &mesh)
+              { this->node_->attachObject(mesh.getEntity()); }
+            inline void detachObject(Ogre::MovableObject *obj)
+              { this->node_->detachObject(obj); }
+            inline void detachAllObjects()
+              { this->node_->detachAllObjects(); }
 
-      inline void setVelocity(const Vector3& velocity)
-          { this->velocity_ = velocity; }
-      inline void setVelocity(Real x, Real y, Real z)
-          { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
-      inline const Vector3& getVelocity() const
-          { return this->velocity_; }
+            inline void setVelocity(const Vector3& velocity)
+                { this->velocity_ = velocity; }
+            inline void setVelocity(Real x, Real y, Real z)
+                { this->velocity_.x = x; this->velocity_.y = y; this->velocity_.z = z; }
+            inline const Vector3& getVelocity() const
+                { return this->velocity_; }
 
-      inline void setAcceleration(const Vector3& acceleration)
-          { this->acceleration_ = acceleration; }
-      inline void setAcceleration(Real x, Real y, Real z)
-          { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
-      inline const Vector3& getAcceleration() const
-          { return this->acceleration_; }
+            inline void setAcceleration(const Vector3& acceleration)
+                { this->acceleration_ = acceleration; }
+            inline void setAcceleration(Real x, Real y, Real z)
+                { this->acceleration_.x = x; this->acceleration_.y = y; this->acceleration_.z = z; }
+            inline const Vector3& getAcceleration() const
+                { return this->acceleration_; }
 
-      inline void setRotationAxis(const Vector3& axis)
-          { this->rotationAxis_ = axis; }
-      inline void setRotationAxis(Real x, Real y, Real z)
-          { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
-      inline const Vector3& getRotationAxis() const
-          { return this->rotationAxis_; }
+            inline void setRotationAxis(const Vector3& axis)
+                { this->rotationAxis_ = axis; }
+//            inline void setRotationAxis(Real x, Real y, Real z)
+//                { this->rotationAxis_.x = x; this->rotationAxis_.y = y; this->rotationAxis_.z = z; }
+            inline const Vector3& getRotationAxis() const
+                { return this->rotationAxis_; }
 
-      inline void setRotationRate(const Radian& angle)
-          { this->rotationRate_ = angle; }
-      inline void setRotationRate(const Degree& angle)
-          { this->rotationRate_ = angle; }
-      inline const Radian& getRotationRate() const
-          { return this->rotationRate_; }
+//            inline void setRotationRate(const Radian& angle)
+//                { this->rotationRate_ = angle; }
+            inline void setRotationRate(const Degree& angle)
+                { this->rotationRate_ = angle; }
+            inline const Radian& getRotationRate() const
+                { return this->rotationRate_; }
 
-      inline void setMomentum(const Radian& angle)
-          { this->momentum_ = angle; }
-      inline void setMomentum(const Degree& angle)
-          { this->momentum_ = angle; }
-      inline const Radian& getMomentum() const
-          { return this->momentum_; }
+            inline void setMomentum(const Radian& angle)
+                { this->momentum_ = angle; }
+            inline void setMomentum(const Degree& angle)
+                { this->momentum_ = angle; }
+            inline const Radian& getMomentum() const
+                { return this->momentum_; }
 
-      inline void setStatic(bool bStatic)
-          { this->bStatic_ = bStatic; }
-      inline bool isStatic()
-          { return this->bStatic_; }
+            inline void setStatic(bool bStatic)
+                { this->bStatic_ = bStatic; }
+            inline bool isStatic()
+                { return this->bStatic_; }
 
-    protected:
-      void registerAllVariables();
+        protected:
+            void registerAllVariables();
 
-      Vector3 velocity_;
-      Vector3 acceleration_;
-      Vector3 rotationAxis_;
-      Radian rotationRate_;
-      Radian momentum_;
+            Vector3 velocity_;
+            Vector3 acceleration_;
+            Vector3 rotationAxis_;
+            Radian rotationRate_;
+            Radian momentum_;
 
-    private:
-      static unsigned int worldEntityCounter_s;
-      Ogre::SceneNode* node_;
-      bool bStatic_;
-  };
+        private:
+            static unsigned int worldEntityCounter_s;
+            Ogre::SceneNode* node_;
+            bool bStatic_;
+    };
 }
 
