A theory construction approach to legal document assembly