Refactoring code to handle XContainer and XElement separately.