At that age, I always told my daughter that your actions speak the truth MUCH louder than your words. And your actions are your best defense against mean people.
I never tried to figure out who was in the right and who was in the wrong when my daughter got into conflicts with people. There's always two sides to every story. Instead, I coached my daughter on taking the high road.
"When someone says something mean, simply roll your eyes, and walk away." (Other options include "amused chuckle", "tolerant smile" and "shake your head and sigh". We practiced!

)
"Go to a teacher or adult, if they persist in following you and saying mean things. Stay calm. Don't let them see weakness."
"Never take the bait. You're a little girl, not a big-mouth bass."
"If someone's trying to assassinate your character, make sure your actions are always above reproach."
"Ignore the obnoxious girls and work on your friendships with the others."
"Watch people. Look for an opportunity to be helpful, even if it's just offering a sharp pencil right after another girl's pencil lead breaks."
"Make eye contact. Smile."
"NEVER say anything mean about another person."
"You can't change other people. You can only change yourself."
Kids aren't stupid. They know who the nice kids are. And people who are absolutely secure in themselves are very attractive to their peers. If you can teach your daughter how to handle these situations now, she'll be better equipped to handle them on her own when she's older and you can't be there.
Good luck!