Add "primary" info to script xml generation and validations