E4X always reduces the <foo></foo> kind of nodes to <foo/> because first is
redundant and ambiguous. It is not clear whether the first kind is in fact
two nodes - an element node with a child text node with the value of empty
string, or is it a single element node. It is also longer than needed, if it
is meant to be a single node.

Well, the result was not missing, it's just that the way you printed it out
was not good. XML.toString() prints the value of the node, not the
structure. The value of the self closing node is "". However, toString()
makes an exception if the node to be printed is the root node, it will print
the structure of the node. I don't know what is the reason behind it.

Reply via email to