if(doc == null)
return null;
// get the root element
Element root = doc.getDocumentElement();
ExecutingMap ret =
new ExecutingMap(
XMLLoader.getHighestID(root) + 1,
XMLLoader.getRequiredTrapRoomCount(root)
);
ret.addRooms(XMLLoader.getRooms(root, ret));
ret.addPositions(XMLLoader.getPositions(root, ret));
ret.addAgents(XMLLoader.getAgents(root, ret));
ret.addItems(XMLLoader.getItems(root, ret));
ret.addLevelNotes(XMLLoader.getNotes(root));
ret.connectPositions();
return ret;
}