This is driving me bonkers... I just want to add another img node.
img
$xml = <<
DOMDocument::getElementsByTagName doesn't return an array, it returns a DOMNodeList. You need to use the item method to access its items:
item
$album = $xmlDoc->getElementsByTagname('album')->item(0);