private void retrieveElements(NodeList nodeList) throws IOException, ParserConfigurationException, SAXException{
        // Retrieve every element from the list
        for (int count = 0; count < nodeList.getLength(); count++) {
            Node tempNode = nodeList.item(count);
            // make sure it's element node.
            if (tempNode.getNodeType() == Node.ELEMENT_NODE) {
                // Create the property element
                PropertyElement propertyElement = new PropertyElement();
                // Store the node name as the parent element
                propertyElement.setParent(tempNode.getNodeName());
                if (tempNode.hasAttributes()) {
                    // get attributes names and values
                    NamedNodeMap nodeMap = tempNode.getAttributes();
                    for (int i = 0; i < nodeMap.getLength(); i++) {
                        Node node = nodeMap.item(i);
                        // Store the node name
                        if("name".equalsIgnoreCase(node.getNodeName())){
                            propertyElement.setName(node.getNodeValue());
                        }
                        // Store the node value
                        if("value".equalsIgnoreCase(node.getNodeName())){
                            propertyElement.setValue(node.getNodeValue());
                        }
                    }
                    // Add the property element to the list
                    listOfElements.add(propertyElement);
                }
                // Iterate recursively through the xml
                if (tempNode.hasChildNodes()) {
                    // loop again if has child nodes
                    retrieveElements(tempNode.getChildNodes());
                }
            }
        }
    }