public void writeAllAssets(String rootDirPath) {
		DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
				.newInstance();
		DocumentBuilder docB;
		try {
			docB = documentBuilderFactory.newDocumentBuilder();
			Document document = docB.newDocument();
			Element root = document.createElement("assets");
			document.appendChild(root);

			for (int i = 0; i < assets.size(); i++) {
				Asset asset = assets.get(i);
				Element assetElement = document.createElement("asset");
				if (asset.getContent() instanceof Mesh) {
					assetElement.setAttribute("type", "mesh");
					Element id = document.createElement("id");
					id.appendChild(document.createTextNode("" + asset.id));
					assetElement.appendChild(id);
					Element file = document.createElement("file");
					file.appendChild(document.createTextNode("asset_"
							+ asset.id + ".obj"));
					assetElement.appendChild(file);
					root.appendChild(assetElement);
					File objFile = new File(rootDirPath + File.separator
							+ "assets" + File.separator + "asset_" + asset.id
							+ ".obj");
					objFile.createNewFile();
					File mtlFile = new File(rootDirPath + File.separator
							+ "assets" + File.separator + "asset_" + asset.id
							+ ".mtl");
					mtlFile.createNewFile();
					ResourceController.writeMeshToObj(objFile.toString(),
							mtlFile.toString(), (Mesh) asset.content);
				}
			}
			ResourceController.writeXML(rootDirPath + File.separator + "assets"
					+ File.separator + "assets.xml", document);
		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (TransformerException e) {
			e.printStackTrace();
		}
	}