You're lucky, what you want already exists: WindowBringer
The procedure is very simple if you have have already a xmonad.hs
configuration file (as described in linked page):
Add the correct import at the beginning:
import XMonad.Actions.WindowBringer
Map keys to functions (to insert near other key mapping):
, ((mod1Mask, xK_g ), gotoMenu)
, ((mod1Mask, xK_b ), bringMenu)
Then when pressing ALT+G that will open dmenu
(like for launching applications) with running application windows name, and then you can enter the beginning of the name and press enter to jump to it.
The behaviour of ALT+B is the same except that it doesn't focus the windows but instead move it to current workspace.