On the stability of switched arx models, with an application to learning via regression trees