Addning a ContentSerializer protocol.

Motivation:
When serializing the document content it is sometimes required to
control the actual content. For example, if the document content is JSON
then it might be required to control the order of the elements, even
though for plain JSON this is not required.