private void updateCurrentValues(NodeList nodeList){
        // Iterate through the list of values to update the xml document
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node currentNode = nodeList.item(i);
            if (currentNode.getNodeType() == Node.ELEMENT_NODE) {
                // Create the property element
                PropertyElement propertyElement = new PropertyElement();
                // Store the node name as the parent element
                propertyElement.setParent(currentNode.getNodeName());
                if (currentNode.hasAttributes()) {
                    // get attributes names and values
                    NamedNodeMap nodeMap = currentNode.getAttributes();
                    propertyElement.setName(nodeMap.getNamedItem("name").getNodeValue());
                    // If the element exists in the list of element then update the node value
                    int index = listOfElements.indexOf(propertyElement);
                    if(index > -1){
                        // Update the value if it's not null
                        if(nodeMap.getNamedItem("value") != null){
                            nodeMap.getNamedItem("value").setNodeValue(listOfElements.get(index).getValue());
                        }
                    }
                }
                // Update all child nodes
                if(currentNode.hasChildNodes()){
                    updateCurrentValues(currentNode.getChildNodes());
                }
            }
        }
    }