This is intended behavior. Think about the text that should be returned for this HTML:

<div>foo<span>bar</span>baz</div>

If you were to try to change the text of that div without changing the descendant elements, you wouldn't have the control you need. Another way to think about it is that if you set the text of an element and then immediately get the text of that element, you shouldn't get a result that differs from what you just set.