@Override
    public void applyAllChanges() throws ApplyChangesException {

        // Make a "backup" first
        Document backup = null;
        try {

            TransformerFactory tfactory = TransformerFactory.newInstance();
            Transformer tx = tfactory.newTransformer();
            DOMSource source = new DOMSource(this.xmlDocument);
            DOMResult result = new DOMResult();
            tx.transform(source, result);
            backup = (Document) result.getNode();
        } catch(TransformerException e) {
            throw new ApplyChangesException(e);
        }

        try {
            MessageUtil.debug("Attempting to apply Changes to DomTree");
            for(InputElement i : inputs) {
                i.apply();
            }
        } catch(XPathExpressionException e) {
            if(backup != null) {
                this.xmlDocument = backup;
            }
            throw new ApplyChangesException(e);
        }
    }