wrap the content of container element with wrapper element

def wrap_content(cls, container, wrapper):
        "wrap the content of container element with wrapper element"
        wrapper.text = (container.text or '') + (wrapper.text or '')
        container.text = ''
        for ch in container:
            wrapper.append(ch)
        container.insert(0, wrapper)
        return container