public static <T> void mergeFrom(XMLStreamReader parser, T message, Schema<T> schema)
            throws IOException, XMLStreamException, XmlInputException
    {
        // final String simpleName = schema.messageName();

        if (parser.nextTag() != START_ELEMENT ||
                !schema.messageName().equals(parser.getLocalName()))
        {
            throw new XmlInputException("Expected token START_ELEMENT: " + schema.messageName());
        }

        if (parser.nextTag() == END_ELEMENT)
        {
            // if(!simpleName.equals(parser.getLocalName()))
            // throw new XmlInputException("Expecting token END_ELEMENT: " + simpleName);

            // empty message;
            return;
        }

        schema.mergeFrom(new XmlInput(parser), message);

        // if(!simpleName.equals(parser.getLocalName()))
        // throw new XmlInputException("Expecting token END_ELEMENT: " + simpleName);
    }
Merges the {@code message} from the {@link XMLStreamReader} using the given {@code schema}.
protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java