Okay let's see if we can break this down to a more manageable level...
;; Starting the VLIDE runtime module
(vl-load-com)
;; Loads the XML-API.vlx
(load "xml-api.vlx")
;; gets a node object corresponding to the 'Job' level of the XML file.
(setq oSettings (XML-Get-XMLObject ("C:\\RTU-2.xml")))
I'm guessing that after this is where you're running into your wall...
And if I'm guessing correctly then what you want to accomplish is actually what's listed below.
;; get down to the Unit node by going through the Product node.
(setq nUnit (XML-Get-Child oSettings "Product" "Unit"))
;; Once we have the Unit node then we can look for the Correct Module, like so...
;; We'll use the Module whose Name is Unit Level for ease of explanation
(setq nModule (XML-Get-Child-ByAttribute nUnit nil "Name" "Unit Level"))
;; Now that that is done, we're going to reach out for the Result Parent Node
(setq nResult (XML-Get-Child nModule "Criteria" "Result"))
;; Okay now we're getting down to the nitty gritty - we're almost there.
;; So now we'll look through the rest of the child nodes, find the one with the correct Result_Field type and
;; then return the Engine_Code value from there.
(setq sVal (XML-Get-Attribute (XML-Get-Child-ByAttribute nResult nil "Type" "value") "Engine_Code" "CC04/BL01"))
;; We set the default value to "CC04/BL01" so at the very least we should get that.
(if (= sVal "CC04/BL01")
(progn
;; ... keep on coding from here
)
)
;; And don't forget to release your objects...
(mapcar 'vlax-release-object (list nResult nModule nUnit oSettings))
Hope this Helps!
P.S.
Keep in mind that I didn't debug this or test it. I just wrote as I went along. Acutally if there are no bugs, then I would be most surprised. However, the whole point of the post was to try to lay out how to use the API. The biggest error I found with the snippet you posted, was that it wasn't going down far enough into the XML nested structure. - Cheers!