Debugged XML Writing