I\'m generating a ton of XML that is to be passed to an API as a post variable when a user click on a form button. I also want to be able to show the user the XML before han
It sounds like you want PHP Output Buffering
ob_start(); // make your XML file $out1 = ob_get_contents(); //$out1 now contains your XML
Note that output buffering stops the output from being sent, until you "flush" it. See the Documentation for more info.