With this code we can create a simple word document but I need to add a Header and a Footer.
let $para1 := ooxml:create-paragraph(fn:concat("Title: ",$title))
let $para2 := ooxml:create-paragraph(fn:concat("Publisher: ",$publisher))
let $paras := ($para1, $para2)
return ooxml:create-simple-docx(ooxml:document(ooxml:body($paras)))
Thanks.