Writes the structural selection to the given file in the given format, and in the given view. Note that only the structural selection is written, not the entire buffer contents.