6 of 6
deleted 136 characters in body

Parse xml for getting data

I need to parse this xml and get last-name by Id(99999) or by Id(55555) based on what I set in method.

<?xml version="1.0"?>
<xmldata
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="SUCCESS">
    <recordset name="object" nritems="1" acl="AW">
        <record name="object" id="99999" acl="DW">
            <field name="last-name" acl="TW">**SS**</field>
        </record>
    </recordset>
</xmldata>

I am trying this for Id

DOM.Document document = new DOM.Document();
document.load(responseBody);
String subjectID = document.getRootElement()
            .getChildElement('recordset', null)
            .getChildElement('recordname', null).getText();