ensure that valueOf (if available) is used before using toInt
partially implement xml settings handling
fix handling of text nodes