Structure
Perhaps the best thing about XPS documents, as opposed to PDF documents, is they are easily consumable by anyone with nothing more than a ZIP file reader and a text editor... for the most part, anyway. Admittedly, it's not that easy to manually edit them, but easier than a PDF.
First thing's first, you'll need to rename your .xps file to .zip. After that, you'll see the following structure...
- _rels
- .rels
- FixedDocumentSequence.fdseq.rels
- Documents
- #
- Metadata
- Pages
- Resources
- FixedDocument.fdoc
- Metadata
- [Content_Types].xml
- FixedDocumentSequence.fdseq
The _rels directory contains file-specific relationships. Each document represents the source of the relationship and specifies a list of target files with corresponding XML namespaces. The .rels file seems to be the base set of relationships, which are relative to the XPS document as a whole.
As expected, the Documents directory contains the main document content. Based on the numbered subdirectory, I'm assuming there can be multiple documents. Unfortunately, I haven't seen one of these, yet, so I'm only speculating -- remember, the documents I've reviewed thus far have been fairly simplistic. Within each numbered document directory, there are three subdirectories: Metadata, Pages, and Resources. The Metadata directory holds page thumbnails (198x256 px in portrait view, 256x198 px in landscape). The Pages directory holds the page content in numbered .fpage files and corresponding relationship files, just like the top-level _rels directory. Finally, the Resources directory contains fonts and images used within the document. I'm assuming embedded content would also be placed here. Outside of these directories, each numbered document directory contains a FixedDocument.fdoc file, which covers what content of the document.
The root Metadata document contains various document properties. There's a lot in here and I didn't bother to figure it all out. Perhaps another time.
Lastly, there are two files in the root, [Content_Types].xml and FixedDocumentSequence.fdseq. The first, obviously, contains all the content types used within the document, which includes their file extension and mime type. The latter file lists the sequence in which contained documents should be sorted.