MATLAB: How to get the attribute out of an XML file

MATLABxml2struct

I have an XML like the below. I am able to use xml2struct (in the file exchange) to read the file. My question is how do I read the contents of "label" (DISSOLVED OXYGEN, pH) out of such files?
<datatypes>
<datatype id="116" label="DISSOLVED OXYGEN"/>
<datatype id="257" label="pH"/>
</datatypes>

Best Answer

Figured it out myself.
xDOC = xml2struct('data/abc.xml');
A = xDOC.datatypes.datatype;
for i=1:length(A);
dataType = A{i}.Attributes.label;
end;
Related Question