/*validate the XML files*/
        public void ValidateXMLFiles(string dir, ref string statusText)
        {
            XMLRoboSimulationProcessor processor = new XMLRoboSimulationProcessor();

            string[] byDirPaths;
            string[] files = Directory.GetFiles(dir, "*.xml", SearchOption.AllDirectories);
            foreach (string file in files)
            {
                //statusText += "Валидирам файл [" + file + "] - ";
                byDirPaths  = file.Split('\\');
                statusText += "Валидирам файл [" + byDirPaths.Last() + "] - ";
                try
                {
                    processor.validateDTDFile(file);
                    statusText += "валиден!";
                }
                catch (XMLRoboSimulationProcessorException pe)
                {
                    statusText += "не е валиден!\n";
                    statusText += "Грешка: " + pe.Message;
                }
                catch (XmlSchemaValidationException xsve)
                {
                    statusText += "не е валиден!\n";
                    statusText += "Грешка в данните: " + xsve.Message;
                }
                statusText += "\n\n";
            }
        }
        /*inserts xml files' data into the DB*/
        public void InsertXmlDataToDB(string dir, ref string statusText)
        {
            XMLRoboSimulationProcessor processor = new XMLRoboSimulationProcessor();

            string[] files = Directory.GetFiles(dir, "*.xml", SearchOption.AllDirectories);
            foreach (string file in files)
            {
                try
                {
                    processor.validateDTDFile(file); // IF the file is not valid it throw exeption
                    processor.LoadRoboSimulationFromXMLUsingReader(file);
                    RoboSimulation roboSimulation = processor.RoboSimulation;
                    InsertRoboSimulationToDB(roboSimulation);
                }
                catch (XMLRoboSimulationProcessorException pe)
                {
                    statusText += pe.Message;
                }
            }
        }