@Override
            protected Input begin(Pipe.Schema<?> pipeSchema) throws IOException
            {
                // final String simpleName = pipeSchema.wrappedSchema.messageName();

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

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

                        // empty message;
                        return null;
                    }
                }
                catch (XMLStreamException e)
                {
                    throw new XmlInputException(e);
                }

                return xmlInput;
            }
Creates an xml pipe from an {@link XMLStreamReader}.
protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java