Handle multiple root elements