protected boolean shouldWriteHeaderAndFooter(){
  return flags.contains(WriterFlags.WRITE_HEADER) || encoding != null || standalone != null;
}

protected boolean shouldWriteHeaderAndFooter ( ) { return flags . contains ( WriterFlags . WRITE_HEADER ) || encoding != null || standalone != null ; }
tests whether header and footer should be included in output
