Use DOMUtils.isText/DOMUtils.isComment where appropriate.

Change-Id: I63df321666cd3e6ce4a6d05a8f2e21b8c619eec0