FileSets allow you to specify a set of patterns to select files, exclusion patterns to exclude certain files, and filters to further limit the files selected. The FileSet can then be used to generate a list of files, which can then be further used in other actions which can either natively use a FileSet object, or can take a list of files (there are many output formats available).
To define a FileSet use the Accessing FileSets to see how other actions in the build can use the list of files selected.