Closes the writer.
This method closes any remaining open elements or attributes.
This method calls the XmlWriter.Flush method to flush the underlying buffered stream and then closes the stream.
This method sets the XmlWriter.WriteState to WriteState.Closed.