#
# small function that creates one xml tag
#

# Escape <, >, & and ", and to produce valid XML
my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=>'&amp;', '"'=>'&quot;');  
my $escape_re  = join '|' => keys %escape;

sub xmlify {
	my $tag = shift;
	my $out;

	$out .= " <$tag>";
	foreach my $v (@_) {
		$v =~ s/($escape_re)/$escape{$1}/g;
		$out .= $v;
	}
	$out .= "</$tag>\n";
	return $out;
}
