Use ET.tostring() to avoid implicit bytes/str conversion issues within ET implementation. Add XML declaration separately to match previous behavior. Signed-off-by: Masashi Honma <masashi.honma@gmail.com>