private Document parseFile(String filePath){
        System.out.println("Parsing Queue file XML ... " + filePath);
        DocumentBuilder docBuilder;
        Document doc = null;
        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
        docBuilderFactory.setIgnoringElementContentWhitespace(true);
        try {
            docBuilder = docBuilderFactory.newDocumentBuilder();
        }
        catch (ParserConfigurationException e) {
            System.err.println("Wrong parser configuration: " + e.getMessage());
            return null;
        }
        try {
            doc = docBuilder.parse(new File(filePath));
        }
        catch (SAXException e) {
            System.err.println("Wrong XML file structure: " + e.getMessage());
            return null;
        }
        catch (IOException e) {
            System.err.println("Could not read source file: " + e.getMessage());
            System.exit(-7);
        }
        System.out.println("Queue file parsed");
        return doc;
    }