Removed the redundant isTextNode function.