Add a document to the xmlwriter structure and pass document when writing

* xmlwriter.c: Add a document to the xmlwriter structure and
  pass document when writing attribute content for encoding support.
2 files changed