writer.writeEndElement();
}
if (config.hasDefined(REWRITE)) {
for (final ModelNode rewritenode : config.get(REWRITE).asList()) {
Property prop = rewritenode.asProperty();
ModelNode rewrite = prop.getValue();
writer.writeStartElement(REWRITE);
writer.writeAttribute(NAME, prop.getName());
WebReWriteDefinition.PATTERN.marshallAsAttribute(rewrite, false, writer);
WebReWriteDefinition.SUBSTITUTION.marshallAsAttribute(rewrite, false, writer);
WebReWriteDefinition.FLAGS.marshallAsAttribute(rewrite, false, writer);
if (rewrite.hasDefined(CONDITION)) {
for (final ModelNode conditionnode : rewrite.get(CONDITION).asList()) {
Property conditionProp = conditionnode.asProperty();
ModelNode condition = conditionProp.getValue();
writer.writeStartElement(CONDITION);
writer.writeAttribute(NAME, conditionProp.getName());
WebReWriteConditionDefinition.TEST.marshallAsAttribute(condition, false, writer);
WebReWriteConditionDefinition.PATTERN.marshallAsAttribute(condition, false, writer);
WebReWriteConditionDefinition.FLAGS.marshallAsAttribute(condition, false, writer);
writer.writeEndElement();
}