The present disclosure provides a method of forming a hermetically sealed enclosure that comprises a diamond material. The method comprises providing first and second enclosure components comprising the diamond material and having first and second recesses, respectively, at edge portions. At least one of the first and second enclosure components has a cavity. The enclosure components have respective contact surfaces at the first and second recesses and are shaped such that an outer channel is formed by the co-operation of the first and second recesses when the first and second enclosure components are contacted at the contact surfaces to form the enclosure. The method further comprises bonding a first type of material to at least surface portions of the first and second recesses of the first and second enclosure components, respectively. The method also comprises bonding a second type of material to the first type of material so that the second type of material covers at least portions of the first type of material. The second type of material is biocompatible and suitable for forming a hermetically sealed seal. In addition, the method comprises contacting the enclosure components to form the enclosure and bonding the second type of material of the first enclosure component to the second type of material of the second enclosure component so as to form a hermetically sealed seal in the outer channel.