make clearEmptyNodes work only with startContainer; Add check for empty nodes before making a clone