$out= fopen("../TEMP/temp.dot","w"); $dot = file("http://localhost:8080/exist/servlet//db/chriswallace/medical/graph.xql"); $dotFile = implode($dot," "); fwrite($out,$dotFile); fclose($out); //set output to be GIF header("Content-type: image/svg+xml"); //execute the dot program and pass thru the output back to the client passthru("/ATT/GraphViz/bin/dot -Tsvg < ../TEMP/temp.dot");