Maybe another suitable format could be GeoJSON. PostGIS can return edge geometries in GeoJSON format with ST_AsGeoJSON
, so all you need to do is wrapping all edges into a GeoJSON "FeatureCollection".
You can find a simple example in the pgRouting workshop: http://workshop.pgrouting.org/chapters/php_server.html#geojson-output
You can create KML, GML, GPX or other formats in a similar way, but GeoJSON is probably the easiest one.