<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize_textbox(ctx, document, txtbox, root):
 """Serialize textbox element."""


    _div = etree.SubElement(root, 'div')
    _div.set('class', 'textbox')

    for elem in txtbox.elements:
        _ser = ctx.get_serializer(elem)

        if _ser:
            _ser(ctx, document, elem, _div)

    fire_hooks(ctx, document, txtbox, _div, ctx.get_hook('textbox'))

    return root