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

    if (context.isStartOfDocument()) {
      getCloudFrontOriginAccessIdentityConfigResult.setETag(context.getHeader("ETag"));
    }

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("CloudFrontOriginAccessIdentityConfig", targetDepth)) {
          getCloudFrontOriginAccessIdentityConfigResult.setCloudFrontOriginAccessIdentityConfig(
              CloudFrontOriginAccessIdentityConfigStaxUnmarshaller.getInstance()
                  .unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return getCloudFrontOriginAccessIdentityConfigResult;
        }
      }
    }
  }
  public CloudFrontOriginAccessIdentity unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    CloudFrontOriginAccessIdentity cloudFrontOriginAccessIdentity =
        new CloudFrontOriginAccessIdentity();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;
    if (context.isStartOfDocument()) targetDepth += 1;

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("Id", targetDepth)) {
          cloudFrontOriginAccessIdentity.setId(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("S3CanonicalUserId", targetDepth)) {
          cloudFrontOriginAccessIdentity.setS3CanonicalUserId(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("CloudFrontOriginAccessIdentityConfig", targetDepth)) {
          cloudFrontOriginAccessIdentity.setCloudFrontOriginAccessIdentityConfig(
              CloudFrontOriginAccessIdentityConfigStaxUnmarshaller.getInstance()
                  .unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return cloudFrontOriginAccessIdentity;
        }
      }
    }
  }