Set the header and footer values in the clones of the master pages
Drop template draw:frames from the clones of the master pages