Add optional XML declaration to pidprinter

Refs #11812