In case the generation of complex sets of documents with finely controlled variations is important to anybody, I mention a long-standing work which I have not yet open sourced - but could do so if interest should emerge. The concepts in short:
(1) Schema-guided document generation is a set of decisions of four kinds:
(a) maxOccurs>1: How many instances?
(b) minOccurs=0, maxOccurs=1: An instance or not?
(c) simple typed: Which text content?
(d) choice: Which branch?
(2) For every decision there is a default value; non-default decisions are specified by a config ("mockfig"); a decision includes (a) a decision target (typically selected by item name or (trailing) data path, supporting wildcards), (b) a decision value