removing autogenerated header content in document template

also adjusting xref handling