Add support generating nested document