The shell script will include mydiagram.preamble when TeX-processing mydiagram.fig. Now, within xfig, you can typeset the whole integral via the text "$\myint$". in your LaTeX source-file preamble ...