Upon document view import, a content repository will automatically add repository metadata in the form of extra properties (at least jcr:primaryType, for example) if these are not already present in the incoming XML, and of course, in the case of an arbitrary XML document, they will not be.

When re-exported using document view, the resulting XML will contain these extra properties in the form of XML attributes that may not have been present in the imported XML. As a result, if roundtripping of arbitrary XML is desired, the application must take care of stripping out unwanted repository-related meta-data like the jcr:primaryType.