fixed crash due to xml_writer initialization bug