Added XML.Children, and small corrections to error handling