         formerType = @type
         @type = @tree.resolveType(struct)
         @attributes = struct.attributes
-        @container.sort()
+        @container.refresh()
         @_rebuildElement(formerType)
         this
 

        else
          throw new Error('Node not in this container')

      element: () ->
        @_element ||= @_buildElement()


          @element()

      # Sort nodes using comparator
      _sort: () ->
        @nodes.sort(@_compareNodes)

      # Walk all nodes in the tree.
