public void saveConfiguration(XMLDocument document) throws XMLException {
		
		// input tests
		if (document == null || document.getJbossesb() == null) {
			throw new XMLException("Input data is null!");
		} 
		if (!confFile.exists() || !confFile.canWrite()) {
			throw new XMLException("File: " + confFile + "is unreachable!");
		}
		if (!isValid()) {
			throw new XMLException("File: " + confFile + "isn't valid JBossESB configuration file");
		}
		
		// initialization 
		Document xmlDocument = changeDataInConfigurationFile(document);
		
		// write data into configuration file
		writeDataIntoConfigurationFile(xmlDocument);		
	}