Implemented basic functionality of xml writer.