I'm still a bit confused about what you are trying to do, so I assume that you want to check your XML file before using it in your web service. In your case, your XML must have a specific attribute.
To do something like this, I usually create an XSD against XML that needs to be retrieved, and use it to validate it against XML. The XSD will contain information that XML must contain a specific node / attribute. You can use visual studio XSD editor to customize these elements.
This section should help you with the verification code after creating the XSD:
XML validation against XSD with reference to C #
source share