Working version of xml writer, uses DTD.
More xml writer improvements.