private static Pair<StorageDomainStatic, Guid> BuildStorageStaticFromXmlRpcStruct(
      Map<String, Object> xmlRpcStruct) {
    Pair<StorageDomainStatic, Guid> returnValue = new Pair<StorageDomainStatic, Guid>();
    StorageDomainStatic sdStatic = new StorageDomainStatic();
    if (xmlRpcStruct.containsKey("name")) {
      sdStatic.setStorageName(xmlRpcStruct.get("name").toString());
    }
    if (xmlRpcStruct.containsKey("type")) {
      sdStatic.setStorageType(
          EnumUtils.valueOf(StorageType.class, xmlRpcStruct.get("type").toString(), true));
    }
    if (xmlRpcStruct.containsKey("class")) {
      String domainType = xmlRpcStruct.get("class").toString();
      if ("backup".equalsIgnoreCase(domainType)) {
        sdStatic.setStorageDomainType(StorageDomainType.ImportExport);
      } else {
        sdStatic.setStorageDomainType(EnumUtils.valueOf(StorageDomainType.class, domainType, true));
      }
    }
    if (xmlRpcStruct.containsKey("version")) {
      sdStatic.setStorageFormat(StorageFormatType.forValue(xmlRpcStruct.get("version").toString()));
    }
    if (sdStatic.getStorageType() != StorageType.UNKNOWN) {
      if (sdStatic.getStorageType().isFileDomain() && xmlRpcStruct.containsKey("remotePath")) {
        String path = xmlRpcStruct.get("remotePath").toString();
        List<StorageServerConnections> connections =
            DbFacade.getInstance().getStorageServerConnectionDao().getAllForStorage(path);
        if (connections.isEmpty()) {
          sdStatic.setConnection(new StorageServerConnections());
          sdStatic.getConnection().setconnection(path);
          sdStatic.getConnection().setstorage_type(sdStatic.getStorageType());
        } else {
          sdStatic.setStorage(connections.get(0).getid());
          sdStatic.setConnection(connections.get(0));
        }
      } else if (sdStatic.getStorageType() != StorageType.NFS
          && (xmlRpcStruct.containsKey("vguuid"))) {
        sdStatic.setStorage(xmlRpcStruct.get("vguuid").toString());
      }
    }
    if (xmlRpcStruct.containsKey("state")) {
      sdStatic.setSanState(
          EnumUtils.valueOf(
              SANState.class, xmlRpcStruct.get("state").toString().toUpperCase(), false));
    }
    returnValue.setFirst(sdStatic);
    Object[] poolUUIDs = (Object[]) xmlRpcStruct.get("pool");
    if (poolUUIDs.length != 0) {
      returnValue.setSecond(Guid.createGuidFromString(poolUUIDs[0].toString()));
    }

    return returnValue;
  }