           fileAs = creator.split(/[ ](?=[^ ]+$)/).reverse().join(', ')
 
           container.append('    ')
-          newCreator = $(template).text(creator)
-            .attr('id', id)
-            .attr('file-as', fileAs)
-            .appendTo(container)
+          newCreator = template.cloneNode()
+          newCreator.setAttribute('id', id)
+          newCreator.setAttributeNS('http://www.idpf.org/2007/opf', 'opf:file-as', fileAs)
+          newCreator.textContent = creator
+          container[0].appendChild(newCreator)
+
           container.append('\n    ')
           $(refinesTemplate)
             .attr('refines', '#' + id)

        tagGroupHelper(
          'dc:subject',
          value,
          {type: "http:\\github.com/Connexions/rhaptos.cnxmlutils/rhaptos/cnxmlutils/schema"}
        )
      @on 'change:rightsHolders', (model, value, options) =>
        tagGroupHelper(


        container = @$xml.find('metadata')
        selector = tagName.replace(':', '\\:')
        template = @$xml[0].createElement(tagName)
 
        _.forIn attributes, (value, key) ->
          selector += "[#{key.replace(':', '\\:')}=\"#{value}\"]"
          template.setAttributeNS('http://www.idpf.org/2007/opf', key, value)

        existing = @$xml.find(selector).remove()

        _.each values, (value) ->
          element = template.cloneNode()
          container.append('    ')
          element.textContent = value
          container[0].appendChild(element)
          container.append('\n')

        setNavModel({})
