What you are referring to is called a heredoc. I believe it originated in PERL but is common in php as well.
Your statement beginning:
$xmlstr = <<<XML
starts the string. Everything after the XML up until the next XML; is assigned to the variable $xmlstr
You can then do a:
print "<P>$xmistr";
What's great about heredocs is you can use php code up to your $xmlstr and again right after the next XML; You are free to mix php variables and regular html together inside the string without escaping quotes or using <?= $name ?> to dispaly $name.
Example:
<?php
$name = "john";
$age = "30";
$str <<<END
<P>My name is $name and I am $age years old.</P>";
END;
echo $str;
?>
This will print:
My name is john and I am 30 years old.