fixed xml writer problem