def format_data_file(self, filename): """ Return an ElementTree node corresponding to a comment containing the text of the specified data file. """ header = "BEASTling embedded data file: %s" % filename fp = Path(filename).open("r") data_block = "\n".join([header, fp.read()]) fp.close() return ET.Comment(data_block)