replacing tidy by html_to_xml and other changes