private ArrayList<CustomerType> readCustomersFile(String filename) throws ParserConfigurationException, SAXException, IOException {
		String typeString = "type";
		String countString = "count";
		String appsString = "appliances";
		String appString = "appliance";
		String appidString = "appid";
		String usageString = "usagegroup";
		String timeslotString = "timeslot";
		String startString = "start";
		String endString = "end";
		String devString = "dev";
		String devUsageString = "devUsage";
		String durationString = "duration";
		
		// create the data structure for the customer types
		ArrayList<CustomerType> custTypeLst = new ArrayList<CustomerType>();
				
		File file = new File(filename);
		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
		DocumentBuilder db = dbf.newDocumentBuilder();
		Document doc = db.parse(file);
		doc.getDocumentElement().normalize();
		NodeList nodeLst = doc.getElementsByTagName("customer");
	 		
		for (int i = 0; i < nodeLst.getLength(); i++) {
			Node custNode = nodeLst.item(i);
			if (custNode.getNodeType() == Node.ELEMENT_NODE) {
					
				Element custElmnt = (Element) custNode;	
				
				// get 'type'
				NodeList typeElmntLst = custElmnt.getElementsByTagName(typeString);
				if (typeElmntLst.getLength()==0 ){
					System.err.println("[main::readCustomersFile] Error: Element '"+ typeString +"' not found in customer #" + (i+1));
					System.exit(1);
				}
				Element typeElmnt = (Element) typeElmntLst.item(0);
				String typeValue = typeElmnt.getFirstChild().getNodeValue();								
				
				// get 'count'
				NodeList countElmntLst = custElmnt.getElementsByTagName(countString);
				if (countElmntLst.getLength()==0 ){
					System.err.println("[main::readCustomersFile] Error: Element '"+ countString +"' not found in customer #" + (i+1));
					System.exit(1);
				}
				Element countElmnt = (Element) countElmntLst.item(0);
				String countValue = countElmnt.getFirstChild().getNodeValue();						
				
				// create CustomerType data structure
				CustomerType custType = new CustomerType(typeValue, Integer.parseInt(countValue));

				// get 'appliances'
				NodeList appsElmntLst = custElmnt.getElementsByTagName(appsString);
				if (countElmntLst.getLength()==0 ){
					System.err.println("[main::readCustomersFile] Error: Element '" + appsString + "' not found in customer #" + (i+1));
					System.exit(1);
				}
				Element appsElmnt = (Element) appsElmntLst.item(0);
				
				//  get all 'appliance'
				NodeList appElmntLst = appsElmnt.getElementsByTagName(appString);					
				for (int j=0;j<appElmntLst.getLength();j++ ){
					Element appElmnt = (Element) appElmntLst.item(j);
					
					// get 'appid'
					NodeList appidElmntLst = appElmnt.getElementsByTagName(appidString);
					Element appidElmnt = (Element) appidElmntLst.item(0);
					String appid = appidElmnt.getFirstChild().getNodeValue();
					
					// create data structure for each appliance
					ApplianceUsage appliance = new ApplianceUsage(appid);
					
					// get all 'usage'
					NodeList usageElmntLst = appElmnt.getElementsByTagName(usageString);
					for (int k=0; k<usageElmntLst.getLength(); k++){
						Element usageElmnt = (Element) usageElmntLst.item(k);
						
						// create a data structure for a UsageGroup
						UsageGroup usageGroup = new UsageGroup();
						
						// get 'timeslot'
						NodeList timeslotElmntLst = usageElmnt.getElementsByTagName(timeslotString);
						for (int m=0; m<timeslotElmntLst.getLength(); m++){								
							Element timeslotElmnt = (Element) timeslotElmntLst.item(m);
							String startValue = timeslotElmnt.getAttribute(startString);
							String endValue = timeslotElmnt.getAttribute(endString);
							String devValue = timeslotElmnt.getAttribute(devString);
							
							usageGroup.addTimeslot(startValue, endValue, devValue);
						}
						
						// get 'duration'
						NodeList durationElmntLst = usageElmnt.getElementsByTagName(durationString);
						Element durationElmnt = (Element) durationElmntLst.item(0);
						String durationValue = durationElmnt.getFirstChild().getNodeValue();
						String devValue = durationElmnt.getAttribute(devString);
						String devUsageValue = durationElmnt.getAttribute(devUsageString);
						usageGroup.setDuration(devValue, devUsageValue, durationValue);
						appliance.addUsageGroup(usageGroup);
						
					} // end for usageGroup iteration
					
					custType.addAppliance(appliance);
					
				} // end for appliance iteration
				
				custTypeLst.add(custType);
				
			} // end if
			
		} // end for iterate over all customer Type
		
		return custTypeLst;
			
	}