Below is my code
var str = "<single><n>Q1</n><v></v><m></m></single>
<single><n>Q2</n><v>y</v><m></m></single>
<single><n>Q3</n><v></v><m>y</m></single>";
// ! I gave this string value in three lines just for readability purpose
var xmlDoc = $.parseXML( str );
var xml = $(xmlDoc);
alert(xml.find('single').size());
But this is not working, Please check this fiddle
Look in the browser’s error console: You will see something like
Adding a root element will fix it: