- protected Element serializeNodeWithParentStructure(final Document document, final YangInstanceIdentifier dataRoot,
- final NormalizedNode node) {
- if (!dataRoot.equals(ROOT)) {
- return (Element) transformNormalizedNode(document,
- ImmutableNodes.fromInstanceId(schemaContext.getCurrentContext(), dataRoot, node),
- ROOT);
+ private static XMLStreamWriter getXmlStreamWriter(final DOMResult result) {
+ try {
+ return XML_OUTPUT_FACTORY.createXMLStreamWriter(result);
+ } catch (final XMLStreamException e) {
+ throw new RuntimeException(e);