Use undocumented xml method ->childnodes

clean up code slightly