- final Optional<DataContainerChild<?, ?>> dataNode =
- ((DataContainerNode<?>) result).getChild(toId(NETCONF_DATA_QNAME));
- if (!dataNode.isPresent()) {
- return Optional.absent();
+
+ final DataContainerChild<?, ?> rpcResult = rpcResultOpt.get();
+ verify(rpcResult instanceof AnyXmlNode, "Unexpected result %s", rpcResult);
+ final NormalizedNode<?, ?> dataNode;
+
+ try {
+ dataNode = NetconfUtil.transformDOMSourceToNormalizedNode(schemaContext,
+ ((AnyXmlNode) rpcResult).getValue()).getResult();
+ } catch (XMLStreamException | URISyntaxException | IOException | SAXException
+ | ParserConfigurationException e) {
+ LOG.warn("Failed to transform {}", rpcResult, e);
+ return Optional.empty();