private boolean parseExits(Document doc)
	{
		NodeList nodes = doc.getElementsByTagName(XmlTag.EDGE_SECTION.toString());
		NodeList exits = ((Element)nodes.item(0)).getElementsByTagName(XmlTag.EDGE.toString());
		for(int exit_num = 0; exit_num < exits.getLength(); exit_num++)
		{
			Item key = null;
			int x1=-1, y1=-1, x2=-1, y2=-1;
			boolean crossable = false;
			String dir1="", dir2="";
			Element exit = (Element) exits.item(exit_num);
			NodeList tiles = exit.getElementsByTagName(XmlTag.TILE.toString());

			String type = exit.getAttribute(XmlTag.TYPE.toString());
			if(type.equalsIgnoreCase(XmlTag.BOUNDRIES.toString()))
			{
				if(!parseBoundaries(exit)) return false;
			}
			else
			{
				//get tile1
				Element tile1 = (Element) tiles.item(0);
				x1 = Integer.parseInt(tile1.getAttribute(XmlTag.X.toString()));
				y1 = Integer.parseInt(tile1.getAttribute(XmlTag.Y.toString()));
				dir1 = tile1.getAttribute(XmlTag.DIRECTION.toString());
				
				//get tile2
				Element tile2 = (Element) tiles.item(1);
				x2 = Integer.parseInt(tile2.getAttribute(XmlTag.X.toString()));
				y2 = Integer.parseInt(tile2.getAttribute(XmlTag.Y.toString()));
				dir2 = tile2.getAttribute(XmlTag.DIRECTION.toString());
				String crossableString = exit.getAttribute(XmlTag.CROSSABLE.toString());
				if(crossableString.equalsIgnoreCase("true")) 
					crossable = true;
				else
					crossable = false;
				if(type.equalsIgnoreCase(XmlTag.EXIT.toString()))
				{
					String locked = exit.getAttribute(XmlTag.LOCKED.toString());
					if(locked.equalsIgnoreCase("true"))
					{
						//if so what is the key
						NodeList items = exit.getElementsByTagName(XmlTag.ITEM.toString());
						Element item = (Element) items.item(0);
						String keyname = item.getAttribute(XmlTag.NAME.toString());
						int keyweight = Integer.parseInt(item.getAttribute(XmlTag.WEIGHT.toString()));
						key = new Item(keyname, keyweight);
		
						crossable = false;
					}
					else
						crossable = true;
				}
				if(!level.addEdge(level.getTile(x1,y1),level.getTile(x2,y2),dir1, dir2, key, crossable)) return false;
			}
		}
		return true;
	}