Improving advertisement XML generation