risolto
Codice PHP:
public function append($string, $path = '//html/body') {
$xpath = new DOMXPath ( $this->response );
$elements = $xpath->evaluate ( $path, $this->response );
foreach ( $elements as $element ) {
if (! $string instanceof DOMNode) {
$string_ = $string;
$string = $this->response->createDocumentFragment ();
$string->appendXML ( $string_ );
}
$element->appendChild ( $this->response->importNode ( $string, true ) );
}
}