I've generated an XML file via PHP. However, the XML has been generated all on one line, with no linebreaks or indentation.
How can I make it so that each link in the XML file appears on a separate line? Here's the code I'm currently using:
$xml = new SimpleXmlElement('<links></links>');
$xml->addChild('dvd');
foreach ($articleList as $art) {
$value = htmlentities($art->getAttribute('href'));
$xml->addChild('alink', $value);
}
$xml->asXML('/simplexml_create.xml');