def find_device_by_address(address, site_id = nil)
      r = execute(make_xml('SiteDeviceListingRequest', { 'site-id' => site_id }))
      if r.success
        device = REXML::XPath.first(r.res, "SiteDeviceListingResponse/SiteDevices/device[@address='#{address}']")
        if device
          return Device.new(device.attributes['id'].to_i,
                            device.attributes['address'],
                            device.parent.attributes['site-id'],
                            device.attributes['riskfactor'].to_f,
                            device.attributes['riskscore'].to_f)
        end
      end
      nil
    end
def find_device_by_address(address, site_id = nil)
      r = execute(make_xml('SiteDeviceListingRequest', { 'site-id' => site_id }))
      if r.success
        device = REXML::XPath.first(r.res, "SiteDeviceListingResponse/SiteDevices/device[@address='#{address}']")
        if device
          return Device.new(device.attributes['id'].to_i,
                            device.attributes['address'],
                            device.parent.attributes['site-id'],
                            device.attributes['riskfactor'].to_f,
                            device.attributes['riskscore'].to_f)
        end
      end
      nil
    end
Find a Device by its address.

 This is a convenience method for finding a single device from a SiteDeviceListing.
 If no site_id is provided, the first matching device will be returned when a device
 occurs across multiple sites.

 @param [String] address Address of the device to find. Usually the IP address.
 @param [FixNum] site_id Site ID to restrict search to.
 @return [Device] The first matching Device with the provided address,
   if found.