def resource_type(resource)
      raise_unless_xpath!(resource)
      type = resource.xpath("string(command/ident/@value)")
      if type.empty?
        raise ArgumentError, "Provided AST node is not a resource"
      end
      type
    end
def resource_type(resource)
      raise_unless_xpath!(resource)
      type = resource.xpath("string(command/ident/@value)")
      if type.empty?
        raise ArgumentError, "Provided AST node is not a resource"
      end
      type
    end
Return the type, e.g. 'package' for a given resource