I assume you only wnt to use xml for this transcation and have not got the xml compiled in to pphp.
you will get a structure and format from the card processor - build it as you would any html page - it is almost like building a table.
// there will be a header hear
$xml = "<TRANSACTION>"
$xml .= "<CARHOLDER>" . $card_holder . "</CARDHOLDER>";
$xml .= "<AMOUNT>" . $amnout . "</AMOUNT>";
$xml .= "<CARDNUMBER>" . $cardnumber . "</CARDNUMBER>";
$xml .= "<CARDTYPE>" . $cardtype . "</CARDTYPE>";
$xml .= "</TRANSACTION>";
if you are using any template class just parse the values in to that. <CARHOLDER>{CARD_HOLDER}</CARDHOLDER>
some of the fields may be optional so an if statement or two would help
decoding the data expat would be good - but a couple of regex would find the required data as that is going to come something like
<RESPONSE>
<STATUS>declined</STATUS>
.
.
.
.
</RESPONSE>
not exactly this but you get the picture again some of the returned data may be optional so you need to allow for this.