working version with const XML