'A copy of a Tag is a new Tag, unconnected to the parse tree.
Its contents are a copy of the old Tag\'s contents.'

def __copy__(self):

    clone = type(self)(None, self.builder, self.name, self.namespace, self.nsprefix, self.attrs)
    for attr in ('can_be_empty_element', 'hidden'):
        setattr(clone, attr, getattr(self, attr))
    for child in self.contents:
        clone.append(child.__copy__())
    return clone
