Conditional check for error node in XML