public void loadXml(String xmlFileName){
    try {
 
	File xmlFile=new File(xmlFileName);
	DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
	DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
	Document doc = dBuilder.parse(xmlFile);
 
	doc.getDocumentElement().normalize();
        
        boolean correctXml=true;
        
        
        Element root=doc.getDocumentElement();
        
        if (root.getNodeName().equals("Towns")){
 
            System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
 
            NodeList nList = doc.getElementsByTagName("town");
 
            System.out.println("***********************************");
 
            for (int temp = 0; temp < nList.getLength(); temp++) {
 
		Node nNode = nList.item(temp);
 
		System.out.println("\nCurrent Element :" + nNode.getNodeName());
 
		if (nNode.getNodeType() == Node.ELEMENT_NODE) {
 
			Element eElement = (Element) nNode;
 
			
			System.out.println("name : " + eElement.getElementsByTagName("name").item(0).getTextContent());
                        String name =eElement.getElementsByTagName("name").item(0).getTextContent();
			System.out.println("town id : " + eElement.getElementsByTagName("id").item(0).getTextContent());
                        System.out.println();
                        Long id = Long.decode(eElement.getElementsByTagName("id").item(0).getTextContent());
                        
                        this.add(new Town(id, name));
		}
            }
        } 
        
        if (root.getNodeName().equals("Airports")){
 
            System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
 
            NodeList nList = doc.getElementsByTagName("Airport");
 
            System.out.println("***********************************");
 
            for (int temp = 0; temp < nList.getLength(); temp++) {
 
		Node nNode = nList.item(temp);
 
		System.out.println("\nCurrent Element :" + nNode.getNodeName());
 
		if (nNode.getNodeType() == Node.ELEMENT_NODE) {
 
			Element eElement = (Element) nNode;
 
			System.out.println("Airport id : " + eElement.getElementsByTagName("airportId").item(0).getTextContent());
                        System.out.println("Town id : " + eElement.getElementsByTagName("locationId").item(0).getTextContent());
			System.out.println("Airport name : " + eElement.getElementsByTagName("name").item(0).getTextContent());
                        Long airportId = Long.decode(eElement.getElementsByTagName("airportId").item(0).getTextContent());
                        Long locationId = Long.decode(eElement.getElementsByTagName("locationId").item(0).getTextContent());
                        String name =eElement.getElementsByTagName("name").item(0).getTextContent();
                        System.out.println();
                        this.add(new Airport(airportId,locationId, name));
		}
            }
        }
          
    } catch (Exception e) {
	e.printStackTrace();
        }
    }