protected static Element createElement(Document document, String tagname,
			Map attributes, String text) {
		// Create the new element.
		Element element = document.createElement(tagname);
		
		// Add the text element.
		if (text != null)
			element.appendChild(document.createTextNode(text));
		return element;
	}