<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def perform_step(file_contents, step):
 """Performs a step of the transformation. :param text file_contents: Contends of the cheetah template :param function step: Function taking xmldoc and returning new contents :returns: new contents of the file. """

    assert type(file_contents) is not bytes
    xmldoc = parse(file_contents)
    return step(xmldoc)