Depends on how the executable (which you refer to as cpp) expects the input:
1. It reads the filename:
echo file1.xml | ./a.out > 3d-1.xml
2. It reads the contents of a file:
./a.out < file1.xml > 3d-1.xml
3. It takes a filename as an argument:
./a.out file1.xml > 3d-1.xml
All of the above presumes that a.out writes its output to stdout.