public void setDocument(Document doc) throws DOMException, TransformerException, XPathExpressionException, IllegalArgumentException, IllegalAccessException, IOException {

		CDATASection section = null;
		Node first = this.node.getFirstChild();
		if(first != null) {
			if(first.getNodeType() == Node.CDATA_SECTION_NODE) {
				section = (CDATASection) first;
			}
		}

		String data = Utilities.stringify(doc, Utilities.StringifyMode.Tight);
		if(section == null) {
			section = this.node.getOwnerDocument().createCDATASection(data);
			this.node.appendChild(section);
		} else {
			section.setData(data);
		}
		
		Settings.getInstance().save();
	}