2 respuestas
You can do this by iterating the XMLNodes using getChildElements
You can use the .getName() on the node to verify that you are in _CREDIT_SCOREString xmlData = '<?xml version="1.0"?>' +
'<_CREDIT_SCORE>' +
' <_CREDIT_SCORE _CreditScore="668" _ReportingAgency="Experian"/>' +
' <_CREDIT_SCORE _CreditScore="658" _ReportingAgency="TransUnion"/>' +
' <_CREDIT_SCORE _CreditScore="660" _ReportingAgency="Equifax"/>' +
'</_CREDIT_SCORE>';
Dom.Document doc = new Dom.Document();
doc.load(xmlData);
for (Dom.XmlNode node : doc.getRootElement().getChildElements()) {
System.debug(node.getAttributeValue('_ReportingAgency', ''));
}