You can create a fragment in a separate XDP file or in the current form design. When you create the fragment in a separate file, you can replace the selected objects with a reference to the fragment file. If you do not replace the selection with a fragment reference, the fragment is created, but the selection remains unchanged and is not connected to the new fragment. Leaving the selection unchanged saves steps when you need to create multiple, similar fragments.
Creating the fragment in the current file is useful when you want to define multiple fragments in one file. Creating multiple fragments in one file can make it easier to update multiple fragments, particularly when the fragments are very similar.
Fragments are identified by the fragment name. When you create the fragment in a separate file, you can also specify the location and the file name. The fragment name does not have to match the file name.
See also 

About creating fragments