 
     variant
 
-  _processCategories: (product, data) ->
+  _processCategories: (product, data, fetchedCategories) ->
     catReferences = []
-    _.each data.Categories?.Category, (c) =>
+    _.each data.Categories[0]?.Category, (c) =>
       categoryId = c.CategoryId[0]
       existingCategory = @_getCategoryByExternalId(categoryId, fetchedCategories)
       id = existingCategory.id

        manufacturers = @_buildManufacturers(manufacturersXML, @productType) if manufacturersXML
        @_updateProductType(@productType, manufacturers) if manufacturers
    .then (productTypeUpdateResult) =>
      @categories = @_buildCategories(@categoriesXML) if @categoriesXML
      creates = @_buildCategoryCreates(@categories, @fetchedCategories) if @categories
      @_batch(_.map(creates, (c) => @_createCategory c), 100) if creates
    .then (createCategoriesResult) =>
      # fetch created categories to get id's used for parent reference creation
      @_fetchCategories()
    .then (fetchedCategories) =>
      @fetchedCategories = @_transformByCategoryExternalId fetchedCategories.result
      updates = @_buildCategoryUpdates(@categories, @fetchedCategories) if @categories
      @_batch(_.map(updates, (c) => @_updateCategory c), 100) if updates
    .then (updateCategoriesResult) =>
      @logger.info '[Products] Products import started...'
      products = @_buildProducts(@productsXML, @productType, @fetchedCategories)
      @logger.info "[Products] About to create '#{_.size products}' products."
      @_batch(_.map(products, (p) => @_createProduct p), 100) if products
    .fail (error) =>
      @logger.error "Error on execute method; #{error}"

      @logger.info "[Manufacturers] No update action for manufacturers attribute '#{attributeName}' required."

  _buildCategories: (data) ->
    @logger.debug "[Categories] data:\n#{utils.pretty data}"
    count = _.size(data.Categories?.Category)
    if count
      @logger.info "[Categories] Import categories found: '#{count}'"
    else
      @logger.info '[Categories] No categories to import found or undefined. Please check categories input XML.'
      return
    categoriesData = data.Categories.Category
    # get root categories only
