function createXML(){
var x, n, t;
x = new XML();
n = x.createElement("HTML");
x.appendChild(n);
n = x.createElement("BODY");
t = x.createTextNode("hello world!");
n.appendChild(t)
x.firstChild.appendChild(n);
x.firstChild.firstChild.attributes.error = "invalid ...";
return x;
}
trace(createXML());
создает?