Corrected XMLElement.getChildren(name), because it was using element.getElementsByTagName(name) which returns all descendants with that tag name, instead of returning only the direct children with that tag name.
In the corrected version, XMLElement.getChildren(name) will return only the direct children with that tag name.
Also created a new method called XMLElement.getDescendants(name), which returns all descendants with that tag name.