Loading data into an array from an XML file

Hi there,

I am trying to make a dynamic diagram and load the data from an XML file.
So there are going to be a box for each tittle and there are going to be connected with a line.
Link function connects p_from to p_to ,now I am trying to load the data from an XML file.(A1 => A2 =>A3 )


var links: Array = new Array();
function Link(p_from: String, p_to: String) {
    if (links[p_from] == undefined) links[p_from] = new Array();
    links[p_from][p_to] = true;
};
                
Link("A1, "A2");
Link("A2", "A3");

I tried to use the following code but it doesn’t work.I would appreciate it if you can help.Thanks


var links: Array = new Array();
function Link(p_from: String, p_to: String) {
    if (links[p_from] == undefined) links[p_from] = new Array();
    links[p_from][p_to] = true;
};
var cats_xml = new XML();
                cats_xml.onLoad = function(loaded){
    }
                }
                
Link(parent.childNodes[0].childNodes[0],parent.childNodes[0].childNodes[1]);
Link(parent.childNodes[0].childNodes[1], "A3");

                cats_xml.load("A.xml");

A.xml:


<A's>
                <title1>
                A1
                </title>
                <title2>
                A2
                </title2>
<A's>