def METHOD_NAME(self, writer, ttFont):
    writer.simpletag("version", version=self.version)
    writer.newline()
    for f, v in sorted(self.features.items(), key=lambda x: x[1].index):
        writer.begintag(
            "feature",
            fid=f,
            label=v.label,
            flags=v.flags,
            default=(v.default if v.default else 0),
        )
        writer.newline()
        for s, l in sorted(v.settings.items()):
            writer.simpletag("setting", value=s, label=l)
            writer.newline()
        writer.endtag("feature")
        writer.newline()