final protected function ExceptionAsXML(\Exception $e, \DOMNode &$par)
	{
		//echo $e . PHP_EOL .  print_r($par, true);
		$exc = $par->appendChild($this->createElement('Exception'));
		$exc->appendChild($this->createElement('File', $e->getFile()));
		$exc->appendChild($this->createElement('Line', $e->getLine()));
		$exc->appendChild($this->createElement('Code', $e->getCode()));
		$exc->appendChild(
			$this->createElement('Message', $e->getMessage())
		);

		array_reduce(
			$e->getTrace(),
			function($parent, $el)
			{
				$trace = $this->createElement('Trace');
				$parent->appendChild($trace);
				$trace->appendChild($this->createElement('File', $el['file']));
				$trace->appendChild($this->createElement('Line', $el['line']));
				$trace->appendChild(
					$this->createElement('Function', $el['function'])
				);
				$trace->appendChild($this->createElement('Type', $el['type']));
				$args = $trace->appendChild($this->createElement('Args'));

				foreach ($el['args'] as $arg) {
					$args->appendChild(
						$this->createElement('Arg', print_r($arg, true))
					);
				}
				return $parent;
			},
			$exc->appendChild($this->createElement('StackTrace'))
		);
	}
final protected function ExceptionAsXML(\Exception $e, \DOMNode &$par)
	{
		//echo $e . PHP_EOL .  print_r($par, true);
		$exc = $par->appendChild($this->createElement('Exception'));
		$exc->appendChild($this->createElement('File', $e->getFile()));
		$exc->appendChild($this->createElement('Line', $e->getLine()));
		$exc->appendChild($this->createElement('Code', $e->getCode()));
		$exc->appendChild(
			$this->createElement('Message', $e->getMessage())
		);

		array_reduce(
			$e->getTrace(),
			function($parent, $el)
			{
				$trace = $this->createElement('Trace');
				$parent->appendChild($trace);
				$trace->appendChild($this->createElement('File', $el['file']));
				$trace->appendChild($this->createElement('Line', $el['line']));
				$trace->appendChild(
					$this->createElement('Function', $el['function'])
				);
				$trace->appendChild($this->createElement('Type', $el['type']));
				$args = $trace->appendChild($this->createElement('Args'));

				foreach ($el['args'] as $arg) {
					$args->appendChild(
						$this->createElement('Arg', print_r($arg, true))
					);
				}
				return $parent;
			},
			$exc->appendChild($this->createElement('StackTrace'))
		);
	}
final protected function ExceptionAsXML ( \ Exception $ e , \ DOMNode & $ par ) { //echo $e . PHP_EOL .  print_r($par, true); $ exc = $ par -> appendChild ( $ this -> createElement ( 'Exception' ) ) ; $ exc -> appendChild ( $ this -> createElement ( 'File' , $ e -> getFile ( ) ) ) ; $ exc -> appendChild ( $ this -> createElement ( 'Line' , $ e -> getLine ( ) ) ) ; $ exc -> appendChild ( $ this -> createElement ( 'Code' , $ e -> getCode ( ) ) ) ; $ exc -> appendChild ( $ this -> createElement ( 'Message' , $ e -> getMessage ( ) ) ) ; array_reduce ( $ e -> getTrace ( ) , function ( $ parent , $ el ) { $ trace = $ this -> createElement ( 'Trace' ) ; $ parent -> appendChild ( $ trace ) ; $ trace -> appendChild ( $ this -> createElement ( 'File' , $ el [ 'file' ] ) ) ; $ trace -> appendChild ( $ this -> createElement ( 'Line' , $ el [ 'line' ] ) ) ; $ trace -> appendChild ( $ this -> createElement ( 'Function' , $ el [ 'function' ] ) ) ; $ trace -> appendChild ( $ this -> createElement ( 'Type' , $ el [ 'type' ] ) ) ; $ args = $ trace -> appendChild ( $ this -> createElement ( 'Args' ) ) ; foreach ( $ el [ 'args' ] as $ arg ) { $ args -> appendChild ( $ this -> createElement ( 'Arg' , print_r ( $ arg , true ) ) ) ; } return $ parent ; } , $ exc -> appendChild ( $ this -> createElement ( 'StackTrace' ) ) ) ; }
Converts a PHP Exception into a populated XML node

@param Exception $e   The exception thrown & caught
@param DOMNode   $par The parent node to be appending to
@return void          $par is a pointer
Converts a PHP Exception into a populated XML node