Work for our target use case. Print the xml declaration and encoding when writing out