replace to_xml with to_string

to_xml is depricated