What is the functionality needed to display XML content in an HTML page using PHP?

To display XML content in an HTML page using PHP, you need to parse the XML data and then format it for display. One way to achieve this is by using the SimpleXML extension in PHP, which allows you to easily parse XML data and access its elements for display on an HTML page.

<?php
$xmlString = '<data><name>John Doe</name><age>30</age></data>';
$xml = simplexml_load_string($xmlString);

echo '<h1>XML Data</h1>';
echo '<p>Name: ' . $xml->name . '</p>';
echo '<p>Age: ' . $xml->age . '</p>';
?>