The package does not contain sources. You need to download them separately if you want to compile your own version.
apt-get source ejabberd
apt-get install build-essential # make, compiler, system libraries, deb toolchain
apt-get build-dep ejabberd # any packages required to build this particular package
Now patch, build, install.
This is obviously just a quick whirlwind intro. You probably want to google a few examples to get a fuller picture. There are several for ejabberd
alone.
In particular, you need to understand how to give your local package a version number which is higher than the current official package, but lower than any future official upgrade.
Alternatively, find someone who has already done this and published the resulting package in a PPA. (Obviously, trust them to not trojanize the binary, or don't install it.)