public static NetconfRpcReply parseRpcReply(CharSequence xml) {
        XMLInputFactory xif = XMLInputFactory.newFactory();
        try {
            XMLStreamReader xsr = xif.createXMLStreamReader(CharSource.wrap(xml).openStream());
            return parseRpcReply(xsr);
        } catch (XMLStreamException | IOException e) {
            log.error("Exception thrown creating XMLStreamReader", e);
            return null;
        }
    }
@Test
    public void testErrorParse() {

        NetconfRpcReply reply = NetconfRpcParserUtil.parseRpcReply(ERROR_DATA2);

        assertThat(reply.messageId(), is("101"));

        List<NetconfRpcError> errs = reply.errors();
        assertThat(errs, hasSize(2));

        NetconfRpcError err1 = errs.get(0);
        assertThat(err1.type(), is(ErrorType.APPLICATION));
        assertThat(err1.tag(), is(ErrorTag.INVALID_VALUE));
        assertThat(err1.severity(), is(ErrorSeverity.ERROR));
        assertThat(err1.path().isPresent(), is(true));
        assertThat(err1.path().get().trim(), is("/t:top/t:interface[t:name=\"Ethernet0/0\"]/t:mtu"));
        assertThat(err1.message(), is(notNullValue()));
        assertThat(err1.message().trim(), is("MTU value 25000 is not within range 256..9192"));
        assertThat(err1.info().size(), is(0));
        assertThat(err1.infoAny(), hasSize(0));
        assertThat(err1.appTag().isPresent(), is(false));

        NetconfRpcError err2 = errs.get(1);
        assertThat(err2.type(), is(ErrorType.APPLICATION));
        assertThat(err2.tag(), is(ErrorTag.INVALID_VALUE));
        assertThat(err2.severity(), is(ErrorSeverity.ERROR));
        assertThat(err2.path().isPresent(), is(true));
        assertThat(err2.path().get().trim(), is("/t:top/t:interface[t:name=\"Ethernet1/0\"]/t:address/t:name"));
        assertThat(err2.message(), is(notNullValue()));
        assertThat(err2.message().trim(), is("Invalid IP address for interface Ethernet1/0"));
        assertThat(err2.info().size(), is(0));
        assertThat(err2.infoAny(), hasSize(0));
        assertThat(err2.appTag().isPresent(), is(false));
    }