smartxml: minor refactoring to improve clarity