writerfilter: initial strict DOCX support

The generate-id() code is just necessary avoid duplicated elements in
the for-each loop. http://mahahegde.com/xslt-distinct-values/ has a
detailed description of the technique used here.

Change-Id: I647efe9d4a0834d3756fe9fa6d706ba6ba4e00f1