In Swift 5, I get the rootElement when I call xmlDocGetRootElement, the type rawValue of rootElement's children is 3. This value in Swift 4.2 is 1. Resulting in an error when I get the children of XMLElement. I guess the children's type rawValue is not a XML_ELEMENT_NODE in Swift 5.