For parsing XML in Progress you have several options. Neither of those are used in your example.
Options:
DATASET and TEMP-TABLES can read (correctly formatted) XML.
Almost any XML can be read by a DATASET that represent the XML. This can be quite easy for simple XMLs. Temp-tables can directly read xml if that xml matches the representation of a temp-table. This isn't usually the case unless the xml indeed is a serialized temp-table.
Reading xml into datasets and temp-tables requires decent knowledge of datasets and temp-tables and how you can format those and adapt them using attributes like "serialize-name", "serialize-hidden" and so on.
Example from https://knowledgebase.progress.com/articles/Article/How-to-read-an-XML-in-a-temp-table-using-READ-XML:
DEFINE VARIABLE lcc AS LONGCHAR INIT "<A><B>Red</B><B>Green</B></A>".
DEFINE TEMP-TABLE ttb SERIALIZE-NAME "B"
FIELD cc AS CHAR XML-NODE-TYPE "text".
DEFINE DATASET dsa SERIALIZE-NAME "A" FOR ttb.
DATASET dsa:READ-XML( "longchar", lcc, ?, ?, ? ).
FOR EACH ttb:
MESSAGE ttb.cc VIEW-AS ALERT-BOX.
END.
Document Object Model (X-DOCUMENT)
Using DOM you create an X-DOCUMENT object and it can read the xml. Then you will have a tree structure containing the XML-data. You will have to parse that yourself so be ready to walk the tree of nodes...
Example (copied from https://knowledgebase.progress.com/articles/Article/P21055):
The below code reads a file called personal.xml, processes all of its child nodes and displays information if the node name is "person":
/* e-attnam.p */
DEFINE VARIABLE hDoc AS HANDLE NO-UNDO.
DEFINE VARIABLE hRoot AS HANDLE NO-UNDO.
DEFINE VARIABLE good AS LOGICAL NO-UNDO.
CREATE X-DOCUMENT hDoc.
CREATE X-NODEREF hRoot.
hDoc:LOAD("file","personal.xml",TRUE).
hDoc:GET-DOCUMENT-ELEMENT(hRoot).
RUN GetChildren(hRoot, 1).
DELETE OBJECT hDoc.
DELETE OBJECT hRoot.
PROCEDURE GetChildren:
DEFINE INPUT PARAMETER hParent AS HANDLE NO-UNDO.
DEFINE INPUT PARAMETER level AS INTEGER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE hNoderef AS HANDLE NO-UNDO.
CREATE X-NODEREF hNoderef.
REPEAT i = 1 TO hParent:NUM-CHILDREN:
good = hParent:GET-CHILD(hNoderef,i).
IF NOT good THEN
LEAVE.
IF hNoderef:SUBTYPE <> "element" THEN
NEXT.
IF hNoderef:NAME = "person" THEN
MESSAGE "getattr id gives" hNoderef:GET-ATTRIBUTE("id") hNoderef:ATTRIBUTE-NAMES.
RUN GetChildren(hNoderef, (level + 1)).
END.
DELETE OBJECT hNoderef.
END PROCEDURE.
Simple API for XML (SAX)
This is perhaps a more lightweight approach to XML. You will have to write code that "reacts" the the presence of certain nodes in the XML.
Example can be found at https://knowledgebase.progress.com/articles/Article/000035469
For all things XML and Progress: https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvxml%2Fpreface.html%23