Fixed quite a few issues. Added in an extra step to allow resolution of references (cross-document references still not supported).  Fixed styles from crashing when no <xmlattr> field was present. Added support for clip-paths.