Added Complex Type handling functions. Made findElement better.