Add RecurciveElement class and the phpunit testing of this