  Given a compact of ${\bf R}^n$, there is always a doubling measure having it
as its support. We use this fact to construct an integral operator that extends
differentiable functions defined on any compact set of ${\bf R}^n$ to the whole
of ${\bf R}^n$. This allows us both to give a new proof of Whitney's extension
theorem and to extend it to Besov spaces defined on arbitrary compact sets of
${\bf R}^n$. We also modify this operator to obtain, under certain assumptions,
holomorphic extensions.
