<p>A nanowire composite and a method of preparing the nanowire composite comprise a template having a plurality of hollow channels, nanowires formed within the respective channels of the template, and a functional element formed by removing a portion of the template so that one or more of the nanowires formed within the portion of the template are exposed. Since the nanowire composite can be prepared in a simple manner at low costs and can be miniaturized, the nanowire composite finds application in resonators and a variety of sensors.</p>