   true
 
 exports.XmlImport.prototype.productType =->
-  rest = new Rest Config
   deferred = Q.defer()
-  rest.GET "/product-types", (error, response, body)->
+  @rest.GET "/product-types", (error, response, body)->
     #console.log("PT: %j", body)
     id = JSON.parse(body).results[0].id
     deferred.resolve id
   deferred.promise
 
 exports.XmlImport.prototype.taxCategory =->
-  rest = new Rest Config
   deferred = Q.defer()
-  rest.GET "/tax-categories", (error, response, body)->
+  @rest.GET "/tax-categories", (error, response, body)->
     #console.log("TC: %j", body)
     id = JSON.parse(body).results[0].id
     deferred.resolve id
   deferred.promise
 
 exports.XmlImport.prototype.customerGroup =->
-  rest = new Rest Config
   deferred = Q.defer()
-  rest.GET "/customer-groups", (error, response, body)->
+  @rest.GET "/customer-groups", (error, response, body)->
     id = JSON.parse(body).results[0].id
     #console.log("CG: %j", body)
     deferred.resolve id

  taxCategoryId = 'TODO'
  customerGroupId = 'TODO'

  @productType().then(@taxCategory()).then(@customerGroup()).then (pId)->
    console.log pId

  for k,row of xmljs.row
    v =

  "<?xml?><root>#{raw}</root>"

exports.XmlImport.prototype.transform = (xml, callback)->
  that = this
  parseString xml, (err, result)->
    console.log('Error on parsing XML:' + err) if err
    that.mapProducts(result.root, callback)

exports.XmlImport.prototype.mapProducts = (xmljs, callback)->
  products = []
