Index: code/branches/FICN/src/loader/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/loader/CMakeLists.txt	(revision 474)
+++ code/branches/FICN/src/loader/CMakeLists.txt	(revision 480)
@@ -4,10 +4,9 @@
 SET( LOADER_SRC_FILES
   LevelLoader.cc
-  #../xml/xmlParser.cc
-  ../tinyxml/tinystr.cc
-  ../tinyxml/tinyxml.cc
-  ../tinyxml/tinyxmlerror.cc
-  ../tinyxml/tinyxmlparser.cc
 )
 
 ADD_LIBRARY(loader SHARED ${LOADER_SRC_FILES})
+
+TARGET_LINK_LIBRARIES( loader
+  xml
+)
Index: code/branches/FICN/src/loader/LevelLoader.cc
===================================================================
--- code/branches/FICN/src/loader/LevelLoader.cc	(revision 474)
+++ code/branches/FICN/src/loader/LevelLoader.cc	(revision 480)
@@ -5,4 +5,6 @@
 #include "tinyxml/tinyxml.h"
 #include "orxonox/core/IdentifierIncludes.h"
+#include "orxonox/core/Error.h"
+#include "orxonox/objects/BaseObject.h"
 
 using namespace std;
@@ -11,12 +13,14 @@
 {
 
-LevelLoader::LevelLoader(string file, string dir)
-{
+LevelLoader::LevelLoader(string file, string path)
+{
+	valid_ = false;
+	
 	// Load XML level file
-	dir.append("/");
-	dir.append(file);	
+	path.append("/");
+	path.append(file);	
 	
 	// Open xml file
-	TiXmlDocument doc(file);
+	doc.LoadFile(path);
 
 	// Check if file was loaded
@@ -24,8 +28,6 @@
 	{
 		TiXmlHandle hDoc(&doc);
-		TiXmlHandle hRoot(0);	
-
+		TiXmlHandle hRoot(0);		
 		TiXmlElement* pElem;
-		
 
 		// Check for root element
@@ -35,4 +37,5 @@
 			// Set root element
 			hRoot = TiXmlHandle(pElem);
+			rootElement = hRoot.Element();
 
 			// Set level description
@@ -44,45 +47,83 @@
 			
 			// Set level name
-			pElem = hRoot.Element();
-			name_ = pElem->Attribute("name");
-			image_ = pElem->Attribute("image");
+			name_ = rootElement->Attribute("name");
+			image_ = rootElement->Attribute("image");
+			
+			valid_ = true;
+		}
+		else
+		{
+			orxonox::Error("Level file has no valid root node");
+		}	
+	}
+	else
+	{
+		orxonox::Error("Could not load level file ");
+	}	
+}
+
+	void LevelLoader::loadLevel()
+	{
+		if (valid_)
+		{
+			TiXmlElement* loadElem;
+			TiXmlElement* worldElem;
+			TiXmlElement* tElem;
+			TiXmlNode* tNode;
+			
 			
 			// Set loading screen
-			pElem = hRoot.FirstChild("loading").Element();
-			if (pElem)
+			loadElem = rootElement->FirstChildElement("loading");
+			if (loadElem)
 			{
 				// Set background
-				pElem = hRoot.FirstChild("loading").FirstChild("background").Element();
-				if (pElem)
+				tElem = loadElem->FirstChildElement("background");
+				if (tElem)
 				{
-					loadingBackgroundColor_ = pElem->Attribute("color");
-					loadingBackgroundImage_ = pElem->Attribute("image");
+					loadingBackgroundColor_ = tElem->Attribute("color");
+					loadingBackgroundImage_ = tElem->Attribute("image");
 				}
 				// Set bar
-				pElem = hRoot.FirstChild("loading").FirstChild("bar").Element();
-				if (pElem)
+				tElem = loadElem->FirstChildElement("bar");
+				if (tElem)
 				{
-					loadingBarImage_ = pElem->Attribute("image");;
-					loadingBarTop_ = pElem->Attribute("top");
-					loadingBarLeft_ = pElem->Attribute("left");
-					loadingBarWidth_ = pElem->Attribute("width");
-					loadingBarHeight_ = pElem->Attribute("height");
+					loadingBarImage_ = tElem->Attribute("image");;
+					loadingBarTop_ = tElem->Attribute("top");
+					loadingBarLeft_ = tElem->Attribute("left");
+					loadingBarWidth_ = tElem->Attribute("width");
+					loadingBarHeight_ = tElem->Attribute("height");
 				}
+				showLoadingScreen();
 			}
-						
-			
-		}
-		else
-		{
-			std::string err = "Level file has no valid root node";
-			std::cout << err << std::endl;
-		}	
-	}
-	else
-	{
-		std::string err = "Could not load level file ";
-		err.append(file); 
-		std::cout << err << std::endl;
-	}	
+			
+			// Load audio
+			// TODO
+			
+			// Load scripts
+			// TODO
+			
+			// Load world
+			worldElem = rootElement->FirstChildElement("world");
+			if (worldElem)
+			{	
+				tNode = 0;
+				while( tNode = worldElem->IterateChildren( tNode ) )
+				{
+					tElem = tNode->ToElement();
+					orxonox::BaseObject* obj = orxonox::ID(tElem->Value())->fabricate();
+					obj->loadParams(tElem);
+				}			
+			}
+			
+			std::cout << "Loading finished!\n\n\n\n\n";						
+		}
+	}
+	
+	void LevelLoader::showLoadingScreen()
+	{
+		std::cout << "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n";
+		std::cout << "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n";
+		std::cout << "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n";
+	}
 	
 	
@@ -130,5 +171,5 @@
 */
 
-}
+
 
 LevelLoader::~LevelLoader()
@@ -154,9 +195,4 @@
 }
 
-void LevelLoader::showLoadingScreen()
-{
-	cout << "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n";
-	cout << "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n";
-}
 
 /*
Index: code/branches/FICN/src/loader/LevelLoader.h
===================================================================
--- code/branches/FICN/src/loader/LevelLoader.h	(revision 474)
+++ code/branches/FICN/src/loader/LevelLoader.h	(revision 480)
@@ -24,17 +24,8 @@
 	{
 	private:
-		/*
-		// XML Nodes 
-		XMLNode rootNode;
-		XMLNode loadingScreenNode;
-		XMLNode worldNode;
-		XMLNode audioNode;
-		XMLNode scriptsNode;
-		*/
 		// Level information
 		std::string name_;
 		std::string description_;
 		std::string image_;
-		
 		std::string loadingBackgroundColor_;
 		std::string loadingBackgroundImage_;
@@ -44,5 +35,9 @@
 		std::string loadingBarWidth_;
 		std::string loadingBarHeight_;
+		
+		bool valid_;
 			
+		TiXmlDocument doc;
+		TiXmlElement* rootElement;	
 	public:
 
@@ -52,4 +47,5 @@
 		
 		void showLoadingScreen();
+		void loadLevel();
 		
 		// Getters
