check depth while scanning
parse root element (and return first one)