NXP-11397: optimize document write