Use the boolean()
XPath function
The boolean function converts its
argument to a boolean as follows:
a number is true if and only if
it is neither positive or negative
zero nor NaNa node-set is true if and only if
it is non-emptya string is true if and only if
its length is non-zeroan object of a type other than
the four basic types is converted to a
boolean in a way that is dependent on
that type
If there is an AttachedXml in the CreditReport of primary Consumer, then it will return true()
.
boolean(/mc:Consumers
/mc:Consumer[@subjectIdentifier="Primary"]
//mc:CreditReport/mc:AttachedXml)