<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _rt_update_docindices(self, element, docstart, docend):
 """Updates the docstart, docend, start and end attributes for the specified element using the new limits for the docstring."""

        #see how many characters have to be added/removed from the end
        #of the current doc limits.
        delta = element.docend - docend
        element.docstart = docstart
        element.docend = docend
        element.start += delta
        element.end += delta

        return delta