Fixed toString() from adding text from text nodes twice.
Added support for foreach without container element.