kernel: implementa save_complex_document() de documents.

Signed-off-by: Francisco Prates <mad.kanie@gmail.com>