%% Get Document Object Model(DOM) Node as Serialized Text
% Read a DOM node from a sample XML file and get the contents of the DOM node as a  character vector.
% Display the contents of the sample XML file, and then import the DOM node from the file.

sampleXMLfile = 'sample.xml';
type(sampleXMLfile)
DOMnode = xmlread(sampleXMLfile);

% Use xmlwrite to return the DOMnode object as a serialized character vector.

text = xmlwrite(DOMnode)

% Copyright 2018 The MathWorks, Inc.