How to deal with a Maltese who has started biting strangers

My Maltese, Arthur, will be 3 years old this coming May. My wife and I (no kids) are his first/only owners. He's always been cautious around strangers, but until recently that was manifested only in his barking, and he'd fairly quickly calm down. When he was about a year old, I even took him with me to visit family in another state and he played with my very young (under 10 years old) nephews with no problems. It didn't even occur to me that he would bite or nip, and he never did.

Cut to earlier this year, he has started to react more aggressively to strangers on walks, and particularly kids. Yesterday on a walk a young kid, probably less than 10 years old, approached and asked to pet him. I didn't give a quick enough "no", and this is my fault. I gave a kind of vague "well, I dunno..." and before I knew it, he was on his knees in front of Arthur and Arthur snarled and nipped him. The kid was a little shocked, and seemed stunned. There were no marks on his hand, though. And after making sure everything was OK, we moved along. (In our neighborhood kids frequently play in groups without adults around.)

So this is a problem. But added to this, in a few months my wife's family will be visiting. They have two young kids ages around 4 and 8. Under no circumstances can any kind of aggression happen.

I realize this is likely my fault for not socializing Arthur better. I'm looking into trainers, but I'm not sure how much we can afford. I've read that this may be a result of over-pampering (which again, my fault), which causes anxiety when he's outside of his comfort zone. In all the years we've had Arthur we have never, believe it or not, had guests over.

Anyway, I would love some advice. I'm a little panicked to say the least. How do I introduce my niece and nephew? I'm at a loss.