FO/PDF output: expand header/footer to fit.  Improved approach to avoiding unwanted recursion (compatible with TOC). XsltFOFunctions: bug fix.