Error when creating xml

Hi,
I’m trying to create an xml. Bellow is a part of my coding;

var _xml =<?xml version = "" encoding = ""?>;
_xml.@version = ‘1.0’;
_xml.@encoding = ‘UTF-8’
_xml.ShipmentOrderRequest.@Version = ‘4.0’;

var _authentication = ;
_authentication.SiteId = globals.site_id;
_authentication.UserId = globals.user_id;
_authentication.ToolType = _toolType;
_authentication.AccessKey = _accessKey;

_xml.ShipmentOrderRequest.appendChild(_authentication);

But when I run it, this gives me the error;
Cannot parse XML: The processing instruction target matching “[xX][mM][lL]” is not allowed.
This coding works when I remove the comment <?xml version = "" encoding = ""?>.

Does anyone have an idea to make this work?

Thanks
Regards,
Hareendra

Have you tried outputting the xml to the console

var _xml =<?xml version = "" encoding = ""?><ShipmentOrderRequest Version=""></ShipmentOrderRequest>;
```It should be

var _xml =

var _shipmentOrderRequest =
_shipmentOrderRequest.(@Version = ‘4.0’);

var _authentication = ;
_authentication.SiteId = globals.site_id;
_authentication.UserId = globals.user_id;
_authentication.ToolType = _toolType;
_authentication.AccessKey = _accessKey;

_shipmentOrderRequest.appendChild(_authentication);

_xml.appendChild(_shipmentOrderRequest);


I did this by heart but I am pretty sure this is the way to go. NO need to 'properly' start the xml. The libs will do that for you.

Hope this helps...

I cant output the file because the error occurs on the first line.
Doesn’t the way you suggest remove the comment line from the xml.
I need the xml to have the format I specified.
How does having two separate variables achieve this?

yes E4X (the xml stuff in rhino) doesnt support declaration as it seems.
So that cant be used in an xml syntax