The JCR API includes mechanisms for importing and exporting all or some of the content of a JCR workspace from/to XML files. But the API also defines two XML formats to choose from: the Document View and System View.
The Document View maps each JCR node to an XML element, and each JCR property to an XML attribute. The advantage of this format is that the XML structure looks very similar to the JCR content.
However, there are several disadvantages. First, because JCR properties are mapped to XML attributes (which can only have a single value), this format is not capable of properly accurately representing multi-valued properties. Most implementations basically just export the first value of a multi-valued property.
The second disadvantage is that Document View does not handle large binary values well. Again, this is because the Document View maps properties to XML attributes, and very large XML attribute values generally pose problems for many XML libraries.
In general, avoid using the Document View for reliable exporting content unless your application requires this view. Never use it for backups of a repository.
The System View treats all JCR nodes and properties as XML elements. So although this is generally more verbose than the Document View, it is the only view that can accurately and efficiently represent any repository content, including large binary values and multi-valued properties.
Always use the System View when transferring content from one repository to another. See the ModeShape backup utility for backing up repository content.