You should just check for xpa != null instead of doing another attribute scan with IsDefined