Convert response to DOMDocument for formatted output

Only if $output is set