I have a procedure that takes in an XML blob and uses this information to edit an xml column. However, I have come across a couple of issues:USING MODIFY('DELETE...') UPDATE bms.CustomerBasket SET ProductXML.modify('delete //OrderLine[1]') WHERE CustomerID = @CustomerID AND @ProductXML.value('(//OrderLine/@CatalogueItemReference)[1]', 'varchar(20)' ) = ProductXML.value('(//OrderLine/@CatalogueItemReference)[1]', 'varchar(20)' ) AND COALESCE(@ProductXML.value('(//OrderLine/@ParentCatalogueItemReference)[1]', 'varchar(20)' ),'Void') = COALESCE(ProductXML.value('(//OrderLine/@ParentCatalogueItemReference)[1]', 'varchar(20)' ),'Void')This code is supposed to remove the OrderLine from the XML Column where it has the same catalogueITemReference and ParentCatalogueItemReference as that contained in the XML variable. However, the WHERE clause is not doing anything. How can I filter the results based on the data in the xml variable???I've tried the following, and that removes all the nodes if the matching attributes are on the first node????? UPDATE bms.CustomerBasket SET ProductXML.modify('delete //OrderLine') FROM bms.CustomerBasket CROSS APPLY @ProductXML.nodes('//OrderLine') as T1(pd) WHERE CustomerID = @CustomerID AND T1.pd.value('(//OrderLine/@CatalogueItemReference)[1]', 'varchar(20)' ) = ProductXML.value('(//OrderLine/@CatalogueItemReference)[1]', 'varchar(20)' ) AND COALESCE(T1.pd.value('(//OrderLine/@ParentCatalogueItemReference)[1]', 'varchar(20)' ),'Void') = COALESCE(ProductXML.value('(//OrderLine/@ParentCatalogueItemReference)[1]', 'varchar(20)' ),'Void')Any assistance will be greatly appreciatedHearty head pats