separating model and xml-writer