support element encoding for aggregate types