protected boolean checkSchema() throws NotValidXMLException
	{
		try 
		{
			if ((xmlFileName != null) && (dtdFileName != null) && (xsdFileName != null))
			{
				SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);	        
				File xsdFile = new File(xsdFileName);
				Schema schema = factory.newSchema(xsdFile);
				Validator validator = schema.newValidator();	
				StreamSource source = null;
				source = new StreamSource(xmlFileName);		        
				validator.validate(source);
				log.debug("Selected XML document is valid for selected XSD Schema: xmlFileName={}, xsdFileName={}", xmlFileName, xsdFileName);
				DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
				dbf.setNamespaceAware(true);
				dbf.setValidating(true);
				DocumentBuilder db;
				InputSource is = null;
				try 
				{
					db = dbf.newDocumentBuilder();
					db.setErrorHandler(new SAXErrorHandler());
					is = new InputSource(xmlFileName);
					db.parse(is);					
					log.debug("Selected XML document is valid for selected DTD Schema: xmlFileName={}, dtdFileName={}", xmlFileName, dtdFileName);
					return true;
				} 
				catch (ParserConfigurationException e) 
				{
					log.error("Can't validate XML file in protected void checkSchema() because of ParserConfigurationException", e);
					throw new NotValidXMLException("Can't validate XML file in protected void checkSchema() because of ParserConfigurationException", e);
				}
				catch (Exception e1)
				{
					log.error("Exception catched during validating DTD schema.", e1);
				}
			}
			else
			{
				log.error("Not valid filenames: xmlFileName={}, dtdFileName={}, xsdFileName={}", new String[]{xmlFileName, dtdFileName, xsdFileName});
			}
		}
		catch (SAXException ex) 
		{
			log.error("{} has encountered an error. Can't proceed, catched an exception:{}.", getClass(), ex.getClass());
			throw new NotValidXMLException("Can't validate XML File.", ex);
		} 
		catch (IOException e) 
		{
			log.error("{} has encountered an error. Can't proceed, catched an exception:{}.", getClass(), e.getClass());
			throw new NotValidXMLException("Can't validate XML File. Can't read XML File (file does not exist or something else).", e);
		}  		
		return false;
	}