Oops.  After the last commit, I realized we could end up passing an
encoding of None to toprettyxml(), where before it was always "utf-8".
The documentation for the method does not specify how it would handle
None, so we should avoid it.