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

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

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("Certificates/Certificate", targetDepth)) {
          describeCertificatesResult.withCertificates(
              CertificateStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("Marker", targetDepth)) {
          describeCertificatesResult.setMarker(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return describeCertificatesResult;
        }
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeCertificatesResult == false) return false;
    DescribeCertificatesResult other = (DescribeCertificatesResult) obj;
    if (other.getCertificates() == null ^ this.getCertificates() == null) return false;
    if (other.getCertificates() != null
        && other.getCertificates().equals(this.getCertificates()) == false) return false;
    if (other.getMarker() == null ^ this.getMarker() == null) return false;
    if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false)
      return false;
    return true;
  }