use strictures; use HTML::Entities qw(decode_entities); use XML::LibXML qw(); my $xml = XML::LibXML->load_xml(string => <<'XML'); XML for my $node ($xml->findnodes('//NODE')) { my $text = $node->getAttribute('text'); #

Non-mortgage&nbsp;debts is yes

my $html = decode_entities $text; #

Non-mortgage debts is yes

}