\DOMDocument -> $xmlDocument (as the comment refers to the variable, not the type).