# Document Representations (DocumentSet and DocSet)

Expere IE offers two ways to represent a set of documents: the DocumentSet and the DocSet objects. The DocumentSet is a simple list of documents used to group documents for a request (or a response as well) while the DocSet is a much richer representation of documents that allows multiple groups of documents based on the intended recipient. A DocSet is always used to represent a fully assembled set of documents, where a DocumentSet may represent either a list of unassembled documents or fully assembled documents. As such, the most common use of a DocumentSet is in a request for documents where the DocumentSet is used to group a list of documents and their corresponding DocumentID elements.

While some operations allow either a DocumentSet or a DocSet to be used on the request, you are encouraged to call the DocSet when working with fully assembled documents. The standard usage is to use the DocumentSet when specifying lists of documents and use the DocSet when working with fully assembled documents. The operations that permit either object on the request include:

- AssembleDocumentSetRequest
- PostProcessRequest

Expere IE returns both the DocumentSet and DocSet objects on a request to generate documents. Operations that return both objects in the response include:

- AssembleDocumentsResponse
- GenerateResponse
- GenerateAndSaveResponse
- PostProcessResponse
- SelectAndGenerateResponse
- SelectAndGenerateTestDocumentResponse
- SelectGenerateAndSaveResponse

A visual representation of the DocSet object looks like:
The object contains IDs along with package and packet objects.

- DocSetTxnIDRef: The reference to the schema identifier for the document set.
- DocSetPackageIDRef: The reference to the package identifier for the document set.
- PackageDocs: Array containing an unbound collection of PackageDoc objects.
- Packet: Object containing the name of the packet and an array containing document information objects.

A visual representation of the DocumentSet object looks like:
The object contains document objects, post-processing instructions (AncillaryOutput options), and data objects.

- Document: Container object used to define a document.
- AncillaryOutput: Array containing an unbound collection of AncillaryOutputOption objects.
- Data: Container object for transaction data inputs and outputs in binary (base64), text, or xml format. It will include all documents in the current packet.

The Data object is returned as part of the DocInstance or Packet under the following conditions:

- If the returned document(s) is a mergedPDF, the Data object is only returned on the Packet level and not the DocInstance level.
- If the returned document(s) is individual PDFs, the Data object is only returned on the DocInstance level and not the Packet level.
- If the returned document(s) is a mergedCopyPDF, the Data object is only returned for all documents on both the DocInstance and Packet levels.