@Override
            protected void end(Pipe.Schema<?> pipeSchema, Input input,
                    boolean cleanupOnly) throws IOException
            {
                if (cleanupOnly)
                {
                    try
                    {
                        parser.close();
                    }
                    catch (XMLStreamException e)
                    {
                        // ignore
                    }
                    return;
                }

                assert input == xmlInput;

                // final String simpleName = pipeSchema.wrappedSchema.messageName();
                // final String localName = parser.getLocalName();

                try
                {
                    parser.close();
                }
                catch (XMLStreamException e)
                {
                    // end of pipe transfer ... ignore
                }

                /*
                 * if(!simpleName.equals(localName)) { throw new XmlInputException("Expecting token END_ELEMENT: " +
                 * simpleName); }
                 */
            }
Creates an xml pipe from an {@link XMLStreamReader}.
protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java