modified to be able to handle simple complexContent