rem: while (tree.firstChild) tree.removeChild(tree.firstChild);  
add:  if (tree.firstChild) { nextChild = tree.firstChild.nextSibling; while (nextChild) { var nextTmp = nextChild.nextSibling; tree.removeChild(nextChild); nextChild = nextTmp; } } 
context: function ClearTreelist(tree){  if (tree)  {    tree.clearItemSelection();    while (tree.firstChild)      tree.removeChild(tree.firstChild);        // Count list items    tree.setAttribute("length", 0);  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/5e38e89e712743aaf0fe0ede8a0f885098acc7de/EdDialogCommon.js/buggy/editor/ui/dialogs/content/EdDialogCommon.js