How to dynamically delete nested XML node?

Hi!

I’m trying to create a visual representation of an XML-structure, that lets me drag and drop nodes around to where I want them.

Everything is prety easy to do except for deleting nodes dynamically. In ActionScript 2.0 you could just use removeNode(), but this is no longer possible if you’d like to stick to ActionScript 3.0 only.

Concider the following XML-structure:

[COLOR=DarkSlateBlue] <nodes>[/COLOR][INDENT][COLOR=DarkSlateBlue] <node1>[/COLOR][INDENT][COLOR=DarkSlateBlue] <node2 />
[/COLOR]
[/INDENT][COLOR=DarkSlateBlue]</node1>
[/COLOR]
[/INDENT][COLOR=DarkSlateBlue]</nodes>[/COLOR]

Now, how do I dynamically delete node2?

I’ve tried to do this in every way I could think of that makes sense, but I always end up with error #1119: Delete operator is not supported with operand of type XMLList.

So how do I make a dynamic reference to an XML-object without getting an XMLList-object?

Please help!

/ Frank