in reply to how to put XML string in table cell

You need to encode the XML tags for the browser to display them - see here for an explanation. It is quite simple to do this using the module HTML::Entities. Note also the safer 3 argument form of open()
use HTML::Entities; open (my $fh, '>', 'tt.html') or die "Could not open tt.html, $!"; my $x= qq(<?xml version="1.0" encoding="utf-8" ?> <Soap-ENV:Envelope> <Soap-ENV:Body> <CheckTrade> <tradeId>49214792</tradeId> </CheckTrade> </Soap-ENV:Body> </Soap-ENV:Envelope> ); encode_entities($x); print $fh "<table><tr><td>Message</td><td>$x</td></tr></table>";