function getElementText(node) {

	if (node == null) {
		return("");
	}
	
	child =  node.firstChild;
	foundCDATA = false;
	foundPlainText = false;
	result = '';
	
	while (child != null) {
		switch (child.nodeType) {
		case 4:
			result = child.nodeValue;
			foundCDATA = true;
			break;
		case 3:
			result = child.nodeValue;
			foundPlainText = true;
			break;
		default:
			break;
		}

		if (foundCDATA == true) { return result; }    
		child = child.nextSibling    
	}
	
	return result;
}