XML is simply a text mark-up specification, just like HTML. There is not really anything to "enable", though certainly PHP has many built-in functions for manipulating XML and there are many external libraries you could use, too. So all you need to do is code your PHP script to output XML instead of HTML, plus you might want to send a header letting the browser know what you are sending:
<?php
header('Content-Type: text/xml');
// rest of script...
?>