可以尝试返回一个字符串值:
<div>
    This text node should be returned.
    <em>And the value of this element.</em>
    And this.
    <p>But this paragraph element should be ignored.</p>
</div>返回的值应该是一个字符串:
This text node should be returned. And the value of this element. And this.相似问题