<Mx: SCRIPT>
<! [CDATA [
Protected function btn1_clickhandler (EVT: mouseevent): void {
Delete somexml. nodetodelete;
Txtarea. Text = somexml. toxmlstring ();
}
Protected function btn2_clickhandler (EVT: mouseevent): void {
Delete somexml. Child. (@ label = 'two') [0];
Txtarea. Text = somexml. toxmlstring ();
}
]>
</MX: SCRIPT>
<Mx: XML id = "somexml">
<Root>
<Child label = "one"/>
<Child label = "two"/>
<Child label = "three"/>
<Nodetodelete label = "four"/>
<Child label = "five"/>
<Nodetodelete label = "six">
<Child label = "seven"/>
<Child label = "Eight"/>
</Nodetodelete>
<Child label = "Nine"/>
</Root>
</MX: XML>
<Mx: applicationcontrolbar dock = "true">
<Mx: button id = "btn1"
Label = "delete & lt; nodetodelete & gt; nodes"
Click = "btn1_clickhandler (event);"/>
<Mx: button id = "btn2"
Label = "delete & lt; Child label = 'two' & gt; node"
Click = "btn2_clickhandler (event);"/>
</MX: applicationcontrolbar>
<Mx: textarea id = "txtarea"
TEXT = "{somexml. toxmlstring ()}"
Width = "300" Height = "200"/>