Input validation for XML files