try {
File file = DigitalObjectUtils.toFile(digitalObject);
/* Create a HarvestSource of the object we want to harvest */
FileHarvestSource source = new FileHarvestSource(file);
/* Get the native Configuration: */
Configuration c = Config.getInstance().getConfiguration("Extract in Native form");
String tempFolder = file.getParent();
c.setOutputDirectory(tempFolder);
/* Harvest the file: */
c.getHarvester().harvest(c, source, new PropsManager());
/* The resulting file is the original file plus ".xml": */
File result = new File(c.getOutputDirectory() + File.separator + file.getName()
+ ".xml");
result.deleteOnExit();
return read(result.getAbsolutePath());
} catch (ConfigurationException e) {
e.printStackTrace();