Replacing deprecated method getchildren.

Using list() instead.