Changed how tags and characters outside of the root element are handled to match with XML5 spec