public BackendServerDescription unmarshall(StaxUnmarshallerContext context) throws Exception {
    BackendServerDescription backendServerDescription = new BackendServerDescription();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return backendServerDescription;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("InstancePort", targetDepth)) {
          backendServerDescription.setInstancePort(
              IntegerStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("PolicyNames/member", targetDepth)) {
          backendServerDescription
              .getPolicyNames()
              .add(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return backendServerDescription;
        }
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof BackendServerDescription == false) return false;
    BackendServerDescription other = (BackendServerDescription) obj;
    if (other.getInstancePort() == null ^ this.getInstancePort() == null) return false;
    if (other.getInstancePort() != null
        && other.getInstancePort().equals(this.getInstancePort()) == false) return false;
    if (other.getPolicyNames() == null ^ this.getPolicyNames() == null) return false;
    if (other.getPolicyNames() != null
        && other.getPolicyNames().equals(this.getPolicyNames()) == false) return false;
    return true;
  }