How to Read xml object in event onAfterSave

I want to read the xml response, to be exact the type, I know that this xml returns:

<?xml version='1.0' ?>

And want to confirm the action and tid in this event to redirect the webpage after a successfully insert, anyone knows how to read correctly this object, I have been trying already but can’t figure out yet what is the correct syntax.

formAdd.attachEvent("onAfterSave", function (id, xml){
       var txt = xml.xmlDoc.responseText;
       var xmltxt = xml.responseXML;

If you are using dataprocessor for data saving you can use events of dataprocessor … fterupdate

Or you can use form’s event, but change your code like

formAdd.attachEvent("onAfterSave", function (id, tag{ var action = tag.getAttribute("action"); var sid = tag.getAttribute("sid"); var tid = tag.getAttribute("tid"); //you can poll any custom attribute in the same way });