How can the Content-Type header be set to properly display XML content in PHP?

To properly display XML content in PHP, the Content-Type header needs to be set to "application/xml". This tells the browser that the content being returned is in XML format and should be parsed as such.

<?php
header('Content-Type: application/xml');
$xmlString = '<?xml version="1.0" encoding="UTF-8"?><root><data>Hello, XML!</data></root>';
echo $xmlString;
?>