public double retrieveCurrentInstant(String node, String balancepost) {
		NodeList nodeList = doc.getElementsByTagName(node);
		double balanspost;
		int numberNodes = doc.getElementsByTagName(node).getLength();
		//System.out.println(balancepost + " - " + numberNodes);
		
		switch (numberNodes) {
		case 3:
			int itemNumberThree = 0;
			String contextRef = nodeList.item(itemNumberThree).getAttributes().getNamedItem("contextRef").getNodeValue();
			//System.out.println(contextRef);
			
			if (contextRef.equals("CurrentInstant") || contextRef.equals("CurrentDuration") ) {
				balanspost = Double.parseDouble(doc.getElementsByTagName(node).item(itemNumberThree).getTextContent());;
				//System.out.println(balancepost + " - " + doc.getElementsByTagName(node).item(1).getTextContent());
			} else {
				balanspost = 0;
			}
			break;
			
		case 2:
			int itemNumberTwo = 0;
			String contextRefTwo = nodeList.item(itemNumberTwo).getAttributes().getNamedItem("contextRef").getNodeValue();
			
			if (contextRefTwo.equals("CurrentInstant") || contextRefTwo.equals("CurrentDuration") ) {
				balanspost = Double.parseDouble(doc.getElementsByTagName(node).item(itemNumberTwo).getTextContent());;
				//System.out.println(balancepost + " - " + doc.getElementsByTagName(node).item(1).getTextContent());
			} else {
				balanspost = 0;
			}
			break;

		case 1:
			int itemNumberOne = 0;
			String contextRefOne = nodeList.item(itemNumberOne).getAttributes().getNamedItem("contextRef").getNodeValue();
			if (contextRefOne.equals("CurrentInstant") || contextRefOne.equals("CurrentDuration")) {
				balanspost = Double.parseDouble(doc.getElementsByTagName(node).item(itemNumberOne).getTextContent());;
				//System.out.println(balancepost + " - " + doc.getElementsByTagName(node).item(1).getTextContent());
			} else {
				balanspost = 0;
			}
			break;	
			
		default:
			balanspost = 0;
			break;
		}
		
		return balanspost;
		

		
	}