public static ArrayList<EARSRequirement> ReadXML(String _fileName) {
        ArrayList<EARSRequirement> reqsList = new ArrayList();
        String opCond, opTrig, sName, sResp, specState, featIncl;
        String reqType, reqCCode, reqIndex;

        try 
        {
         // if(XmlValidate.validate(_fileName))
          //{  
            File xmlRead = new File(_fileName);

            DocumentBuilderFactory documentFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();
            Document doc = documentBuilder.parse(xmlRead);
            doc.getDocumentElement().normalize();
            NodeList nodeList = doc.getElementsByTagName("req");

            System.out.println("Root element :" + doc.getDocumentElement().getNodeName());

            for (int reqNum = 0; reqNum < nodeList.getLength(); reqNum++) {
                Node node = nodeList.item(reqNum);
                if (node.getNodeType() == Node.ELEMENT_NODE) {
                    Element EARSReq = (Element) node;
                    reqType = EARSReq.getElementsByTagName("req_type").item(0).getTextContent();
                    switch (reqType) {
                        case "Ubiquitous":
                            sName = EARSReq.getElementsByTagName("system_name").item(0).getTextContent();
                            sResp = EARSReq.getElementsByTagName("system_response").item(0).getTextContent();
                            reqCCode = EARSReq.getElementsByTagName("colour_code").item(0).getTextContent();
                            reqIndex = EARSReq.getElementsByTagName("rId").item(0).getTextContent();
                            UbiquitousRequirement ur = new UbiquitousRequirement(sName, sResp, reqCCode, reqIndex);
                            reqsList.add(ur);
                            break;
                        case "Event Driven":
                            opCond = EARSReq.getElementsByTagName("precondition").item(0).getTextContent();
                            opTrig = EARSReq.getElementsByTagName("trigger").item(0).getTextContent();
                            sName = EARSReq.getElementsByTagName("system_name").item(0).getTextContent();
                            sResp = EARSReq.getElementsByTagName("system_response").item(0).getTextContent();
                            reqCCode = EARSReq.getElementsByTagName("colour_code").item(0).getTextContent();
                            reqIndex = EARSReq.getElementsByTagName("rId").item(0).getTextContent();
                            EventDrivenRequirement edr = new EventDrivenRequirement(opCond, opTrig, sName, sResp, reqCCode, reqIndex);
                            reqsList.add(edr);
                            break;
                        case "Unwanted Behaviour":
                            opCond = EARSReq.getElementsByTagName("precondition").item(0).getTextContent();
                            opTrig = EARSReq.getElementsByTagName("trigger").item(0).getTextContent();
                            sName = EARSReq.getElementsByTagName("system_name").item(0).getTextContent();
                            sResp = EARSReq.getElementsByTagName("system_response").item(0).getTextContent();
                            reqCCode = EARSReq.getElementsByTagName("colour_code").item(0).getTextContent();
                            reqIndex = EARSReq.getElementsByTagName("rId").item(0).getTextContent();
                            UnwantedBehaviour ubr = new UnwantedBehaviour(opCond, opTrig, sName, sResp, reqCCode, reqIndex);
                            reqsList.add(ubr);
                            break;
                        case "State Driven":
                            specState = EARSReq.getElementsByTagName("specific_state").item(0).getTextContent();
                            sName = EARSReq.getElementsByTagName("system_name").item(0).getTextContent();
                            sResp = EARSReq.getElementsByTagName("system_response").item(0).getTextContent();
                            reqCCode = EARSReq.getElementsByTagName("colour_code").item(0).getTextContent();
                            reqIndex = EARSReq.getElementsByTagName("rId").item(0).getTextContent();
                            StateDrivenReq sdr = new StateDrivenReq(specState, sName, sResp, reqCCode, reqIndex);
                            reqsList.add(sdr);
                            break;
                        case "Optional Features":
                            featIncl = EARSReq.getElementsByTagName("feature_included").item(0).getTextContent();
                            sName = EARSReq.getElementsByTagName("system_name").item(0).getTextContent();
                            sResp = EARSReq.getElementsByTagName("system_response").item(0).getTextContent();
                            reqCCode = EARSReq.getElementsByTagName("colour_code").item(0).getTextContent();
                            reqIndex = EARSReq.getElementsByTagName("rId").item(0).getTextContent();
                            OptionalFeatures opF = new OptionalFeatures(featIncl, sName, sResp, reqCCode, reqIndex);
                            reqsList.add(opF);
                            break;
                    }
                }
            }
            for(EARSRequirement req : reqsList){
                System.out.println(req.getReqType());
            }
          //}   
        } catch (ParserConfigurationException | SAXException | IOException | DOMException ex) {}
        return reqsList;
    }