Index: /code/branches/presentation/src/core/BaseObject.cc
===================================================================
--- /code/branches/presentation/src/core/BaseObject.cc	(revision 2538)
+++ /code/branches/presentation/src/core/BaseObject.cc	(revision 2539)
@@ -61,4 +61,6 @@
         this->oldGametype_ = 0;
 
+        this->lastLoadedXMLElement_ = 0;
+
         this->functorSetMainState_ = 0;
         this->functorGetMainState_ = 0;
Index: /code/branches/presentation/src/core/BaseObject.h
===================================================================
--- /code/branches/presentation/src/core/BaseObject.h	(revision 2538)
+++ /code/branches/presentation/src/core/BaseObject.h	(revision 2539)
@@ -62,4 +62,6 @@
     class _CoreExport BaseObject : virtual public OrxonoxClass
     {
+        template <class T> friend class XMLPortClassParamContainer;
+
         public:
             BaseObject(BaseObject* creator);
@@ -173,8 +175,8 @@
 
         protected:
-            std::string name_;                          //!< The name of the object
-            std::string oldName_;                       //!< The old name of the object
-            mbool       bActive_;                       //!< True = the object is active
-            mbool       bVisible_;                      //!< True = the object is visible
+            std::string name_;                                 //!< The name of the object
+            std::string oldName_;                              //!< The old name of the object
+            mbool       bActive_;                              //!< True = the object is active
+            mbool       bVisible_;                             //!< True = the object is visible
             std::string mainStateName_;
             Functor*    functorSetMainState_;
@@ -185,7 +187,9 @@
             Template* getTemplate(unsigned int index) const;
 
-            bool                   bInitialized_;         //!< True if the object was initialized (passed the object registration)
-            const XMLFile*         file_;                 //!< The XMLFile that loaded this object
-            std::string            loaderIndentation_;    //!< Indentation of the debug output in the Loader
+            bool                   bInitialized_;              //!< True if the object was initialized (passed the object registration)
+            const XMLFile*         file_;                      //!< The XMLFile that loaded this object
+            Element*               lastLoadedXMLElement_;      //!< Non 0 if the TinyXML attributes have already been copied to our own lowercase map
+            std::map<std::string, std::string> xmlAttributes_; //!< Lowercase XML attributes
+            std::string            loaderIndentation_;         //!< Indentation of the debug output in the Loader
             Namespace*             namespace_;
             BaseObject*            creator_;
Index: /code/branches/presentation/src/core/XMLIncludes.h
===================================================================
--- /code/branches/presentation/src/core/XMLIncludes.h	(revision 2538)
+++ /code/branches/presentation/src/core/XMLIncludes.h	(revision 2539)
@@ -64,10 +64,10 @@
 namespace orxonox
 {
-    typedef ticpp::Document Document;
-    typedef ticpp::Element Element;
-    typedef ticpp::Declaration Declaration;
-    typedef ticpp::StylesheetReference StylesheetReference;
-    typedef ticpp::Text Text;
-    typedef ticpp::Comment Comment;
-    typedef ticpp::Attribute Attribute;
+    using ticpp::Document;
+    using ticpp::Element;
+    using ticpp::Declaration;
+    using ticpp::StylesheetReference;
+    using ticpp::Text;
+    using ticpp::Comment;
+    using ticpp::Attribute;
 }
Index: /code/branches/presentation/src/core/XMLPort.h
===================================================================
--- /code/branches/presentation/src/core/XMLPort.h	(revision 2538)
+++ /code/branches/presentation/src/core/XMLPort.h	(revision 2539)
@@ -182,5 +182,5 @@
         ClassIdentifier<classname>::getIdentifier()->addXMLPortParamContainer(paramname, containername); \
     } \
-    containername->port((BaseObject*)this, object, xmlelement, mode)
+    containername->port(static_cast<BaseObject*>(this), object, xmlelement, mode)
 
 // --------------------
@@ -360,4 +360,5 @@
             XMLPortParamContainer& port(BaseObject* owner, T* object, Element& xmlelement, XMLPort::Mode mode)
             {
+                OrxAssert(owner, "XMLPortParamContainer must have a BaseObject as owner.");
                 this->owner_ = owner;
                 this->parseParams_.object = object;
@@ -369,9 +370,27 @@
                     try
                     {
-                        std::string attribute = xmlelement.GetAttribute(this->paramname_);
-                        if ((attribute.size() > 0) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
+                        if (this->owner_->lastLoadedXMLElement_ != &xmlelement)
+                        {
+                            this->owner_->xmlAttributes_.clear();
+                            // Iterate through the attributes manually in order to make them case insensitive
+                            Attribute* attribute = xmlelement.FirstAttribute(false);
+                            while (attribute != 0)
+                            {
+                                this->owner_->xmlAttributes_[getLowercase(attribute->Name())] = attribute->Value();
+                                attribute = attribute->Next(false);
+                            }
+                            this->owner_->lastLoadedXMLElement_ = &xmlelement;
+                        }
+                        std::map<std::string, std::string>::const_iterator it = this->owner_->xmlAttributes_.find(getLowercase(this->paramname_));
+                        std::string attributeValue("");
+                        if (it != this->owner_->xmlAttributes_.end())
+                            attributeValue = it->second;
+
+                        // TODO: Checking the iterator would be better since then we can have strings with value "" as well.
+                        //       Unfortunately this does not seem to work with the Executor parser yet.
+                        if ((!attributeValue.empty()) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet()))
                         {
                             COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation();
-                            if (this->loadexecutor_->parse(object, attribute, ",") || (mode  == XMLPort::ExpandObject))
+                            if (this->loadexecutor_->parse(object, attributeValue, ",") || (mode  == XMLPort::ExpandObject))
                                 this->parseResult_ = PR_finished;
                             else
