This sounds a lot like what my DS went through at about 18 months - tender, slightly swollen and warm. We put him in a warm bath, then lots of white "stuff" came out after the soak. I always thought this was an irritation or infection from powder or dipes, but now I know it was normal - just part of the separation process and passing smegma that had been building up under the foreskin (helping the process along). So I'd advise doing the warm bath thing and letting whatever comes out come out. Do not let the doctor retract! Any infection must be cultured to diagnose, but again, this sounds like a normal part of development and not pathological.