public void parseXML() throws FileNotFoundException {

        try {
            if (file != null) {
                DocumentBuilderFactory newDocumentBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder newBuilder = newDocumentBuilderFactory.newDocumentBuilder();
                Document doc = newBuilder.parse(file);
                doc.getDocumentElement().normalize();            
                
                NodeList nodeList = doc.getElementsByTagName("loc");             
                
                fullPaths = new String[nodeList.getLength()];

                for (int i = 0; i < nodeList.getLength(); i++) {
                    Node newNode = nodeList.item(i);
                    fullPaths[i] = newNode.getTextContent().toLowerCase();
                }
                //Initialize ArrayList objects
                urls = new ArrayList<>();
                
                for(String fullPath : fullPaths) {
                    boolean stored = false; // Flag to see if we've matched an extension
                    // Check for query string in path
                    if (fullPath.contains("?")) {
                        fullPath = getBaseURL(fullPath); // Strip off query string
                        // Check for a duplicate of the base url
                        stored = isDuplicateURL(fullPath);
                    }
                    
                    if (!stored) {
                        boolean matched = matchPath(urlExtensions, fullPath);
                        if (!matched) {
                            urls.add(new URL(fullPath, "other", URLType.Page));
                        }
                    }
                }               
            }
        } catch (ParserConfigurationException | SAXException | IOException | DOMException e) {
            System.out.println(e);
        }

        Collections.sort(urls);

    }