The Flatten Schema command is enabled when an XML Schema is the active document. It generates a new flat XSD by (i) adding the components of all included schemas as global components of the active schema, and (ii) deleting the included schemas.
The command redirects to the Flatten Schema command of the Schema Design menu. Since the Flatten Schema command is available in Schema View only, you will be prompted about whether you wish to switch to Schema View or not. For more information, see the Flatten Schema command.