Updated XML writer for filename based on debug