I have written a SQL query for inserting data into a table from a xml. Using xml nodes function data is retrieved and inserted into the table. When I execute the query as a static query I am able to insert data in the table. But when I convert it to dynamic query and use exec statement then it is not inserting any data. SP is not throwing any error as well. Can someone help. Urgent. Below is the SP and the input parameter.

Code:
CREATE PROCEDURE [dbo].[P_Ins_Details]
(
	@P_InsQuery varchar(max),
	@P_SelQuery varchar(max),
	@P_input varchar(max),
	@P_xmlName varchar(max),
	@P_prodName INT,
	@P_Created_User varchar(max),
	@P_NumberofRows INT,
	@P_Account_No varchar(15) = NULL
)
AS
BEGIN	
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    BEGIN TRAN T1
		
		DECLARE @xml xml
		DECLARE @tableName varchar(max)
		DECLARE @strInsert varchar(max)
		DECLARE @strColumnName varchar(max)
		DECLARE @strColumnValue varchar(max)
		DECLARE @CurrentRow INT
		DECLARE @strExceptionList varchar(max)
		DECLARE @strWhereClause varchar(max)
		DECLARE @strExceptionWhere varchar(max)
		DECLARE @date datetime
		DECLARE @strDate varchar(max)					

		SET @xml = CAST (@P_input AS xml)
		SET @CurrentRow = 0
		SET @date = GetDate()
		SET @strDate = CAST(DATEPART(mm,@date) AS VARCHAR)+'-'+CAST(DATEPART(dd,@date) AS VARCHAR)+'-'+CAST(DATEPART(yyyy,@date) AS VARCHAR)+' '+'00:00:00'  

		SELECT 
			@tableName = REPLACE(CTMM_MASTER_TABLE_NAME, 'MASTER', 'PROCESS') 
		FROM 
			CITI_TABLE_MAPPING_MASTER 
		WHERE 
			CTMM_ID = @P_prodName

		SET @strInsert = 'INSERT INTO '

		SET @strColumnName = '(' + @P_InsQuery + ', CREATED_USER, CREATED_DT_TIME, '+ @tableName +'.STATUS) '

		IF @P_Account_No IS NULL
		BEGIN
			SET @strColumnValue = @P_SelQuery + ', ' + @P_Created_User + ', '+ @strDate + ', U '
		END
		ELSE
		BEGIN
			SET @strColumnValue = @P_SelQuery + ', '''+ @P_Account_No + ''', ''' + @P_Created_User + ''', '''+ @strDate + ''', ''U'' '
		END				

		WHILE	@CurrentRow < @P_NumberofRows
		BEGIN
			BEGIN TRY
				SET @CurrentRow = @CurrentRow + 1
				SET @strWhereClause = 'WHERE doc.col.value(''id[1]'', ''int'') = '+ CONVERT(VARCHAR(max),@CurrentRow)																									
				EXEC (@strInsert + @tableName + @strColumnName + @strColumnValue + @P_xmlName + @strWhereClause)						
			END TRY
			BEGIN CATCH
				IF @strExceptionList IS NULL
				BEGIN					
					SET @strExceptionList = CONVERT(VARCHAR(max),@CurrentRow)
				END
				ELSE
				BEGIN
					SET @strExceptionList = @strExceptionList + ',' + CONVERT(VARCHAR(max),@CurrentRow)
				END
				CONTINUE
			END CATCH					
		SET @strExceptionWhere = ' WHERE doc.col.value(''id[1]'', ''int'') in (' + @strExceptionList + ')'		
		EXEC(@P_SelQuery + @P_xmlName + @strExceptionWhere) 
	END
COMMIT TRAN T1	
END
Code:
Input parameter

@P_InsQuery = N'BENE_NAME ,BENE_IFSC_CODE ,BENE_ACC_NO ,BENE_PAYBLE_LOCATION ,BENE_REMARKS ,DEBIT_ACC_NO ',
		@P_SelQuery = N'SELECT doc.col.value(''BENE_NAME[1]'',''varchar(max)'') ,doc.col.value(''BENE_IFSC_CODE[1]'',''varchar(max)'') ,doc.col.value(''BENE_ACC_NO[1]'',''varchar(max)'') ,doc.col.value(''BENE_PAYBLE_LOCATION[1]'',''varchar(max)'') ,doc.col.value(''BENE_REMARKS[1]'',''varchar(max)'') ',
		@P_input = N'<DocumentElement>
  <CitiMasterData>
    <BENE_NAME>Debankita</BENE_NAME>
    <BENE_IFSC_CODE>123123123</BENE_IFSC_CODE>
    <BENE_ACC_NO>SBI1234567</BENE_ACC_NO>
    <BENE_PAYBLE_LOCATION>Kolkata</BENE_PAYBLE_LOCATION>
    <BENE_REMARKS>Nothing</BENE_REMARKS>
    <id>1</id>
  </CitiMasterData>
  <CitiMasterData>
    <BENE_NAME>Anirban</BENE_NAME>
    <BENE_IFSC_CODE>789789789</BENE_IFSC_CODE>
    <BENE_ACC_NO>CITI456789</BENE_ACC_NO>
    <BENE_PAYBLE_LOCATION>Kolkata</BENE_PAYBLE_LOCATION>
    <BENE_REMARKS>What remark!</BENE_REMARKS>
    <id>2</id>
  </CitiMasterData>
  <CitiMasterData>
    <BENE_NAME>Arindam</BENE_NAME>
    <BENE_IFSC_CODE>456456456</BENE_IFSC_CODE>
    <BENE_ACC_NO>HDF7897897</BENE_ACC_NO>
    <BENE_PAYBLE_LOCATION>Mumbai</BENE_PAYBLE_LOCATION>
    <BENE_REMARKS>Nothing to say</BENE_REMARKS>
    <id>3</id>
  </CitiMasterData>
  <CitiMasterData>
    <BENE_NAME>Subham</BENE_NAME>
    <BENE_IFSC_CODE>4564897231</BENE_IFSC_CODE>
    <BENE_ACC_NO>ICICI34567</BENE_ACC_NO>
    <BENE_PAYBLE_LOCATION>Bangalore</BENE_PAYBLE_LOCATION>
    <id>4</id>
  </CitiMasterData>
</DocumentElement>',
		@P_xmlName = N' FROM @xml.nodes(''/DocumentElement/CitiMasterData'') doc(col) ',
		@P_prodName = 1,
		@P_Created_User = N'abcd',
		@P_NumberofRows = 4,
		@P_Account_No = N'8858797'
Please help.