I believe you could use JavaScript to dynamically assign your action variable based on the button, or you could assign this as a choice using an input field. However, I'm not a Java Script expert.
Here's how I would handle the multiple buttons, using PHP and HTML only. When you create your buttons, give them the same name, but assign a different value to each button (xml, txt, etc...) You will need to use the same action, so you might want to make a generic output page (dooutput.php) that will read that value of 'submit' and do what you want it to from there.
Good Luck.
David