I agree with all of the above except the "pain in kids is never muscle related". That's bunk, I'm not sure in what context the physician would say that. Muscles that are injured respond in the same way, whether it is a child or adult--inflammation and resulting pain. While I agree it could be some sort of orthopedic injury, I don't think it *has* to be.
In addition to the above suggestions, a couple of other things crossed mind:
Anemia: If she's exercising a lot (or just growing) and she is anemic, her muscles are deprived of oxygen upon exertion. This can cause cramping and residual aching.
Electrolyte imbalance: Having a lyte imbalance or being dehydrated, particularly during and/or after exercise, can cause muscle aches.
Not enough protein in her diet: If she's building muscle tissue (exercising and/or growing), protein is at the top of the list for this. Tissue is made from protein. If she's not getting enough, this means her muscle tissue can't build/repair itself, causing pain.
Poorly fitting or unsupportive shoes: Make sure her shoes fit well and provide support. Some shoe store will now evaluate your feet, to see if you need some sort of insert. Podiatrists should be able to do this, too. As anyone who works on their feet knows, improper shoes kill your legs and back.
What's her sleep surface like? Try sleeping on it yourself for a night--does it cause you pain? If so, it might be the culprit for her back and subsequent leg pain.
Does she warm up and cool down after swimming and other exercise? Could she not be stretching properly?
How is her posture? Some girls tend to slouch, particularly when they start developing. This can cause back pain et referred leg pain. Teach her to square her shoulders, and to sit and stand with good posture.
Sometimes an infection will cause muscle aches. These are usually viral, and run their course in 2-4 weeks.
If she were my child, I would check out some of the most obvious culprits, make sure she was eating, drinking, and sleeping properly, maybe add a multivitamin if she isn't already taking one, and see what happens. If the pain interferes with her ability to run, walk, sleep, or play, I would take her to the doctor.