To get data from ganglia .rrd files and save it in .xml file, you can use rddtool.
rrdtool dump filename.rrd [filename.xml] [--header|-h {none,xsd,dtd}] [--no-header] [--daemon address] > filename.xml
example:
sudo rrdtool dump bytes_out.rrd > data.xml