Optimize and refactor node output implementation a bit (+5% perf gain)

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1019 99668b35-9821-0410-8761-19e4c4f06640