I am a veterinarian and I LOVE LOVE LOVE Diane B.'s and Lee P.'s responses! To them I would just add (and agree) that at their ages, euthanizing an animal might be beyond their comprehension, as far as understand why it is a good thing. It can be difficult enough for them to deal with their beloved pet being gone, without adding the whole element of "The veterinarian gave her a shot that helped her to die..." or whatever. You don't want them hating or being afraid of the vet for "killing" their dog or taking her away. Or upset at you for allowing it to happen. And you don't want them to be afraid of falling asleep, or to be afraid of any shots that they get thinking the same thing might happen to them. Or thinking that the pet being "put to sleep" means they will wake up again at some point. It's different when your kids are older - at 7 and 8 my stepsons asked me about my job and if I had to "put animals to sleep" as part of it, and I said yes, but it was a good thing, because these pets were already sick and in pain and it was not right to allow them to suffer if we could not help them feel any better. And they seemed to understand that and be okay with it.
I would just prep them with the fact that she is very old and very sick, and often when animals are very old and very sick, they might die because their bodies just can't work anymore. If you have any belief system about where we go after we die, you can let them know that the same thing happens to our pets, so they will be in a wonderful place where they won't be sick or in pain anymore and they will be well taken care of (I once had a client who was really struggling with the fact that his 16 year old cat was dying of kidney failure and he couldn't face the idea of euthanasia, because he was Catholic - and they were taught that animals did not have souls and therefore did not go to Heaven afterwords and it troubled him deeply to think that his beloved cat would not be in Heaven in some way. I told him I did NOT believe that, and as far as I was concerned, he could believe whatever he wanted - that seemed to help him.) If you can, I would just have it done while someone else is watching them and they are out of the house and then when you see them, you can just tell them about the dog.
There are some really great kids books out there that deal with losing a pet, including one called "Dog Heaven" (whose author I can't recall - sorry.) There is a story about "Cat Heaven" as well. You can also try to come up with some ways that they can remember their dog, like making a scrapbook or planting a tree in their memory. Some vet hospitals will also make ink or clay paw prints for you of your pet as a keepsake as well.
Good luck with everything, I am very sorry that you have to deal with this right now and for your loss...