I am unable to understand "And this causes empty folders added in a tree view when user clicks them."
The mx_internal_uid node is added to recognize different nodes. But this should not be causing any problems.
Well, If I have a <Projekti> -node, that doesn't have any child nodes in it, it doesn't show up as a expandable folder in tree view. But when the internal_uid node is placed inside the empty Projekti-node, it appears as a folder and there's one empty child in it.
I know this is way after-the-fact, but I just ran into this problem myself today. I found that it generated the mx_internal_uid if the node I was selecting was an XMLList instead of XML. A simple cast fixed the problem.
P.S. "And this causes empty folders added into a tree view when user clicks on them." makes perfect sense when you're using the XML inside a <mx:Tree>. As soon as you select the item (whether by clicking or programmatically), you get extra nodes in the tree.