Here’s Alex Booton’s suggestion:

I use a D40 with an SB400 on a flash bracket quite often. I use Stroboframe’s cheapest bracket, which is called a Quickflip 350 with an SC28 cord. It works great and it’s simple, but keep in mind that unlike the bigger flashes, the SB400 does not line up directly over the camera. Very close, but not quite, so you might on occasion still get a very faint, but pesky shadow down the right side of your subject.