Added pretty_print option to to_xml()