One could simple write their own "echo" function which only takes an XML object parameter.
// This works
write(<span class="username">{$_POST['name']}</span>);
// Where as this wouldn't work
write($_POST['name']);
I think perhaps the use of echo in these examples is just a simplification. More than likely, in Facebook, these XML classes are outputted by another function.