Finish xml_document