created xml writer and implemented part of it