var XML = (function() {
if ( window.ActiveXObject ) {
return {
newDocument: function() {
return new ActiveXObject( 'MSXML2.DOMDocument' );
},
parse: function( text ) {
var doc = this.newDocument();
doc.loadXML( text );
return doc;
}
};
} else {
return {
newDocument: function() {
document.implementation.createDocument( null, null, null );
},
parse: function( text ) {
var parser = new DOMParser();
return parser.parseFromString( text, 'application/xml' );
}
};
}
}());
var xmlDoc = XML.parse( '<?xml version="1.0"?>\
<methodResponse>\
<names>\
<item>Igor</item>\
<item>Gena</item>\
</names>\
<text>\
bla-bla-bla\
</text>\
</methodResponse>' );
debugger;
а, вообще, читаем
Фленагана.