public static Element createElement(Node parent, String prefix, String name, Map<String, String> namespaces) {
		if(parent == null) {
			throw new IllegalArgumentException("Parent node can not be null.");
		}

		String uri = null;
		if(!isNullOrWhitespace(prefix) && namespaces != null) {
			uri = namespaces.get(prefix);
		}
		
		Element elem = null;
		if(uri == null) {
			elem = parent.getOwnerDocument().createElement(name);
		} else {
			elem = parent.getOwnerDocument().createElementNS(uri, name);
			elem.setPrefix(prefix);
		}
		
		parent.appendChild(elem);
		
		return elem;
	}