@Override
    public <T> void writeObject(final int fieldNumber, final T value, final Schema<T> schema,
            final boolean repeated) throws IOException
    {
        final Schema<?> lastSchema = this.schema;
        this.schema = schema;

        final XMLStreamWriter writer = this.writer;
        try
        {
            writer.writeStartElement(lastSchema.getFieldName(fieldNumber));

            schema.writeTo(this, value);

            writer.writeEndElement();
        }
        catch (XMLStreamException e)
        {
            throw new XmlOutputException(e);
        }

        // restore state
        this.schema = lastSchema;
    }
An output used for writing data with xml format.

@author David Yu
@created May 24, 2010
protostuff-xml/src/main/java/io/protostuff/XmlOutput.java