Recovering the Real-Space Correlation Function from Photometric Redshift Surveys