Change xml_output function to an HTMLParser method