Support more than two levels of nested elements