// 
// removeWhiteSpaceDOM(node, recursive)
// - because of the way that IE and Firefox report whitespace (Firefox treats 
// - it like an element in the DOM and IE, oddly enough, ignores it), we run
// - this function on the root of our XML doc before we work on it so that IE 
// - and Firefox show the same DOM structure
// - bpz 11/28/2006

function removeWhiteSpaceDOM(node, recursive) {

	var childNode;
	
	for (var i=node.childNodes.length-1 ; i >=0 ; i--) {
	
		childNode = node.childNodes[i];
		
		if (childNode.nodeType == 3 && !(/\S/.test(childNode.nodeValue))) {
			
			node.removeChild(childNode);
		
		} else if (recursive && childNode.hasChildNodes()) {
		
			removeWhiteSpaceDOM(childNode, true);
		
		}
	
	}

}

// removeNode(node)
// - a method to remove a node 
// - bpz 11/28/2006

function removeNode(node) {
	
	if (node.parentNode.removeChild(node)) {
		
		return true;
		
	} else {
		
		return false;
	
	}
	
}