xml imports uses the refactored code

migrated the xml importing to use the classes created as part of the
refactoring, and to use common code between it and the flare import