Add utility functions to parse and to compose the document