def load_roster(self, source):
try:<EOL><INDENT>tree = ElementTree.parse(source)<EOL><DEDENT>except ElementTree.ParseError as err:<EOL><INDENT>raise ValueError("<STR_LIT>".format(err))<EOL><DEDENT>roster = Roster.from_xml(tree.getroot())<EOL>for item in roster:<EOL><INDENT>item.verify_roster_result(True)<EOL><DEDENT>self.roster = roster<EOL>
Load roster from an XML file.

        Can be used before the connection is started to load saved
        roster copy, for efficient retrieval of versioned roster.

        :Parameters:
            - `source`: file name or a file object
        :Types:
            - `source`: `str` or file-like object