String fitsXMLResult = result.getFitsXMLString();
String fitsXMLSample = sample.getFitsXMLString();
XmlExtractor extractor = new XmlExtractor();
extractor.setNamespaceContext(new FitsNamespaceContext());
if ((fitsXMLResult != null) && (fitsXMLSample != null)) {
// so we have a fits xml, lets analyse it:
try {
StringReader reader = new StringReader(fitsXMLResult);
Document fitsDocResult = extractor.getDocument(new InputSource(reader));