Fix LT-15872: Skip xhtml generation for unselected list items

Change-Id: I689740dfb3c854b72473a3e4bd414c7302366d68