Updated write xml method of CustomTools class to output pretty XML