def build(self, builder):
        """Build XML by appending to builder"""
        params = dict(OID=self.oid, Name=self.name, DataType=self.datatype.value)
        if self.sas_format_name is not None:
            params["SASFormatName"] = self.sas_format_name
        builder.start("CodeList", params)

        for item in self.codelist_items:
            item.build(builder)

        for alias in self.aliases:
            alias.build(builder)

        builder.end("CodeList")