An invitation to your old flame's wedding just arrived. There's a slight pang. Memories of your relationship come flooding back and you spend a few days deciding if you should politely decline and send a nice gift, or keep your chin up and RSVP yes. It is completely understandable and in no way rude to decline the invitation if you feel uncomfortable about it. If you fear your presence at the wedding could be awkward for the couple, rest assured that they wouldn't have invited you unless they genuinely hope you will be able to attend. Let's say you've decided to go. Here are a few things to think about.

Were you the favorite girlfriend of the family? The boyfriend her mom always hoped she'd marry? If so, the family will probably be glad to see you. They may even make a fuss over you. This is your moment to be gracious. When the aunt with all that lip liner clutches your arm and says, "We always hoped you two would get together," you might retort with a smile, "I know they're perfect for each other. See how great they look together?" In other words, deflect the attention onto the couple and away from references to the past.
When the groom's dad puts his arm around your shoulder and says, "How did you let her get away?" or "You two were meant for each other," take a moment. People really do say things like this. Take a small breath and say, "They're very happy together, don't you think? Congratulations. This is a great wedding."
Conversely, were you the boyfriend chased off the property with a shotgun? The girlfriend his sisters tried to trip in the hallway? You may get a few sneers, or think you hear muttering behind hands? "That's HIM" or "Can you believe she had the gall?" But whether favorite or shunned, rise above it all. Be polite. Be confident. Know that you've made the right choices.
At every opportunity, shift the conversation away from yourself. If someone asks how you know Dan or Jenny, prefer an answer like, "Oh, we're old friends," or "We went to college together," to something like, "Oh, Dan was my boyfriend for six years. Yup. We thought about getting married, but he insisted on eating herring for breakfast every day. Can you believe that? Fish in the morning? Anyway, I just couldn't live with that. We broke up." Keep it light. Keep it simple. It might be a good idea to find some old friends, people who know your history and won't ask all the awkward questions. Sit with them and keep a low profile.
The moment will come when you are face to face with the couple, whether in the receiving line or at the reception. How should you react? It's best to play out a few scenarios in your head beforehand. It is completely acceptable to give your friend a kiss on the cheek or to shake hands. Trust your instincts here, but avoid giving a big bear hug. Be confident, dignified, and never sheepish. Take the high road and congratulate the couple rather than making a joke about your presence. Don't linger.
At the top of the list of the don'ts when attending an old flame's wedding: don't imagine yourself up there saying, "I do." This is probably impossible, but try not to. Focus on the couple and how happy they are together. Let your inner voice be the party guest who was talking to the lip liner aunt and the groom's dad. Focus. Focus. Remember what you loved about the person getting married, and not your reasons for parting. In a way, this marriage might be the last chapter of your relationship with your ex. Sad? Perhaps. But flip it over, and you can view it as closure.
This will probably not be the wedding to search for your future spouse. We've established that your profile should be low, so flirting except in the subtlest way is probably out. A certain amount of attention, friendly or otherwise, will be focused on you during the event, so a final caveat might be to go easy on the glasses of wine. How tempting it is to have a couple of drinks, just to take the edge off, tell a story a little too loudly, dance wildly across the floor, your head thrown back in laughter. But refrain madam. Hold back sir. You have plenty of time.