fixed handling of child elements
Merge pull request #12 from dotch/master

fixed handling of child elements