private void buildTree(Document doc, Element root) {    
        doc.setXmlStandalone(true);
        doc.setStrictErrorChecking(true);
        doc.setXmlVersion("1.0");
        
        Element subRoot;     
        Element e;
        
        subRoot = createElement(doc, "Towns", null);
        for(Town i: towns){		
            String[] args = {"name","id"};	
            e = createXmlObj(doc,"town", args,i.getName(),i.getId().toString());
            //e.setAttribute("id", i.getId().toString());
            subRoot.appendChild(e); 	
        }	  
        root.appendChild(subRoot);
        
        
        subRoot = createElement(doc, "Airports", null);  
        for(Airport i: aports){	
        	String[] args = {"airportId","locationId","name"};
        	e = createXmlObj(doc,"Airport", args,i.getAirportId().toString(),i.getLocationId().toString(),i.getAirportName());
           	//e.setAttribute("airportId", i.getAirportId().toString());
        	subRoot.appendChild(e); 
		}	  
        root.appendChild(subRoot);
        
        
    }