code: def serialize_filesec(self):
          
          if (
              self.type.lower() not in ("item", "archival information package")
              or self.use is None
          ):
              return None
          el = etree.Element(utils.lxmlns("mets") + "file", ID=self.file_id())
          if self.group_id():
              el.attrib["GROUPID"] = self.group_id()
          if self.admids:
              el.set("ADMID", " ".join(self.admids))
          if self.checksum and self.checksumtype:
              el.attrib["CHECKSUM"] = self.checksum
              el.attrib["CHECKSUMTYPE"] = self.checksumtype
          if self.path:
              flocat = etree.SubElement(el, utils.lxmlns("mets") + "FLocat")
              # Setting manually so order is correct
              try:
                  flocat.set(utils.lxmlns("xlink") + "href", utils.urlencode(self.path))
              except ValueError:
                  raise exceptions.SerializeError(
                      'Value "{}" (for attribute xlink:href) is not a valid'
                      " URL.".format(self.path)
                  )
              flocat.set("LOCTYPE", "OTHER")
              flocat.set("OTHERLOCTYPE", "SYSTEM")
          for transform_file in self.transform_files:
              transform_file_el = etree.SubElement(
                  el, utils.lxmlns("mets") + "transformFile"
              )
              for key, val in transform_file.items():
                  attribute = "transform{}".format(key).upper()
                  transform_file_el.attrib[attribute] = str(val)
          return el
docs: Return the file Element for this file, appropriate for use in a fileSec.
  
          If this is not an Item or has no use, return None.
  
          :return: fileSec element for this FSEntry