[DependencyInjection] Fix #10626, use better check on attribute existence and values on XML load