Add xml writer
need to be tested!