get xml after writer.flush