What are the advantages and disadvantages of using XML files to store data for PHP applications?

When storing data for PHP applications, using XML files can have advantages such as being human-readable, easily parsed by PHP, and supporting hierarchical data structures. However, XML files can be verbose and less efficient for large datasets compared to other storage formats like JSON or databases.

// Example of reading data from an XML file in PHP
$xml = simplexml_load_file('data.xml');
foreach ($xml->children() as $child) {
    echo $child->getName() . ": " . $child . "<br>";
}