code: function getAttr(obj, attr) {
    if (!obj) { return; }
  
    if (Array.isArray(obj)) {
      obj = obj[0];
    }
  
    return (attr && obj['@']) ? obj['@'][attr] : obj['@'];
  }
docs: Fetches a specific attribute or the whole attribute for an object
  
  @param obj
  @param attr
  @returns {*}