Fixed writing text node.
Tested and updated the traverser encoding in php 5.4.