construct document from static/dynamic fields; remove dead element; add hidden field to store doc; add id for our form