Closes this XML Writer by writing end tags for all elements currently open. Once this function is called, no more elements can be added to the output document.