public DecisionTree parse(File f) throws FileNotFoundException, XMLStreamException {
		DecisionTree result = null;
		DecisionTreeNode root = null;
		String[] labels = null;
		
		//Open XML file
		InputStream is = new FileInputStream(f);
		XMLInputFactory factory = XMLInputFactory.newInstance();
		XMLStreamReader reader = factory.createXMLStreamReader(is);
		
		//Read XML
		while(reader.hasNext()) {
			if(reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
				switch(reader.getLocalName()) {
					case "tree":
						root = parseNode(reader, labels);
						break;
					case "target_labels":
						//Parse labels
						labels = new String[reader.getAttributeCount()];
						for(int i=0; i < reader.getAttributeCount(); i++) {
							int labelIndex = Integer.parseInt(reader.getAttributeLocalName(i).substring(1));
							labels[labelIndex] = reader.getAttributeValue(i);
						}
						break;
				}
			}
			reader.next();
		}
		
		result = new DecisionTree(root);
		
		return result;
	}