Add writetoxml bool variable