There is no such thing as "mixed nodes". I think your difficulty is related to the case where you have the node
<name>first name</name>
"in the middle of other text". In fact, there is no such thing. From the DOM standpoint, the actual hierarchy looks like this:
Element: "child"
Text node: "word text "
Element: "name"
Text node: "first name"
Text node: "word text"
Are you getting the idea? There is no any "mixed" nodes here. Instead of having a text node with some content in the middle, you have two separate ones. I hope it will help you.
—SA