Insert and modify document