<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __select_builder(lxml_builder, libxml2_builder, cmdline_builder):
 """ Selects a builder, based on which Python modules are present. """

    if prefer_xsltproc:
        return cmdline_builder
    
    if not has_libxml2:
        # At the moment we prefer libxml2 over lxml, the latter can lead
        # to conflicts when installed together with libxml2.
        if has_lxml:
            return lxml_builder
        else:
            return cmdline_builder

    return libxml2_builder