function removeKids(ele) {
	while(ele.childNodes.length > 0) {
		ele.removeChild(ele.firstChild);
	}
}

function replaceText(ele,txt) {
	removeKids(ele);
	if (txt && txt.length) ele.appendChild(document.createTextNode(txt));
}