Implement isEqualNode() method for Text and Comment nodes