Adding factory method to XMLResourceExtractor.
Adding new test to ResourceExtractorTest and refactoring.: