 _ = require('underscore')._
 _s = require 'underscore.string'
 {parseString} = require 'xml2js'
-
 
 exports.xmlVal = (elem, attribName, fallback) ->
   return elem[attribName][0] if elem[attribName]

  fs.readFile file, 'utf8', (error, result) ->
    if error
      message = "Can not read file '#{file}'; #{error}"
      console.error message
      deferred.reject message
      process.exit 1
    else
      deferred.resolve result
  deferred.promise

  parseString content, (error, result) ->
    if error
      message = "Can not parse XML content; #{error}"
      deferred.reject message
    else
      deferred.resolve result
  deferred.promise

exports.pretty = (data) ->
  JSON.stringify data, null, 4
