Below is my element hierarchy. How to check (using xpath) that AttachedXml element is present under CreditReport of Primary
Use:
boolean(/*/*[@subjectIdentifier="Primary"]/*/*/*/* [name()='AttachedXml' and namespace-uri()='http://xml.mycompany.com/XMLSchema' ] )