See if this helps you:
Js:
var tags = $("ul li").map( function(){
return $(this).html();
}).get(); // get all tags in an Array. I suspect you meant Array by saying `multi row strings`
$("#main ul").remove();
$("#main").append(tags);
Fot Html;
<div id="main">
<ul>
<li><a>1.1</a></li>
<li><a>1.N</a></li>
<li><ul>
<li><a>2.1</a></li>
</li><ul>
<li><a>3.1</a></li>
<li><a>3.N</a></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>