Create a DOM tree for the »toplevel« window; must be a child of root ».«.
The preamble is internal created whenever »xml« is omitted. Be aware any attribute for the toplevel window will be skipped.
Predefined pattern –from can2svg– are wrong. Tested with safari 4.0 and reimplemented accordingly. A path element must be used for the pattern and it has to be rotated in order to match Tk's version exactly, done.