private void addNode(Element rootElement, TreeItem treeItem, Document xml) {
		Element childElement = xml.createElement(VCNConstants.NODE);
		childElement.setAttribute(VCNConstants.NAME, treeItem.getText());
		childElement.setAttribute(VCNConstants.EXPANDED, treeItem.getExpanded() + "");

		Element textElement = xml.createElement(VCNConstants.TEXT);
		VCNTreeItem item = (VCNTreeItem)treeItem;
		textElement.setAttribute(VCNConstants.CONTENT, (String) ((VCNTreeItem)treeItem).getContent());
		textElement.setAttribute(VCNConstants.WRAP, ((VCNTreeItem)treeItem).isWrap() + "");
		textElement.setAttribute(VCNConstants.IS_BOLD_ITEM_NAME, ((VCNTreeItem)treeItem).isBold() + "");
		
		if (item.isOwnForeground()) {
			Color color = item.getForeground();
			textElement.setAttribute(VCNConstants.ITEM_NAME_COLOR, color.getRed() + "-" + color.getGreen() + "-" + color.getBlue());
		}
		childElement.appendChild(textElement);

		rootElement.appendChild(childElement);

		TreeItem[] tis = treeItem.getItems();
		if (tis == null) {
			return;
		}

		for (TreeItem ti : tis) {
			addNode(childElement, ti, xml);
		}
	}