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

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

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("Options", targetDepth)) {
          synonymOptionsStatus.setOptions(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("Status", targetDepth)) {
          synonymOptionsStatus.setStatus(
              OptionStatusStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return synonymOptionsStatus;
        }
      }
    }
  }
  public LiteralOptions unmarshall(StaxUnmarshallerContext context) throws Exception {
    LiteralOptions literalOptions = new LiteralOptions();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

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

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("DefaultValue", targetDepth)) {
          literalOptions.setDefaultValue(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("SearchEnabled", targetDepth)) {
          literalOptions.setSearchEnabled(
              BooleanStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("FacetEnabled", targetDepth)) {
          literalOptions.setFacetEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("ResultEnabled", targetDepth)) {
          literalOptions.setResultEnabled(
              BooleanStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return literalOptions;
        }
      }
    }
  }