I have a function I am using to generate a chunk of html and which returns a DOMDocument, I am then trying to append that DOMDocument to an existing element I have using a forea