Convert child item iterations to firstChild() and nextSibling().