That very part was to fulfill the scriptures written by Isaiah which he cited.
Isaiah 53:12 (KJV)
12 [...] because he hath poured out his soul unto death: and he was numbered with the transgressors; and he bare the sin of many, and made intercession for the transgressors.
Link it also to the fact that he was on the cross in the middle of 2 robbers.
Now, the high priests seek to trick Jesus with questions so they could incriminate him, but they had no reason to. A crime had to be committed before they could at least justify their arrest in the garden.
Luke 20:20 (KJV)
20 And they watched him, and sent forth spies, which should feign themselves just men, that they might take hold of his words, that so they might deliver him unto the power and authority of the governor.
The emphasis on the swords could not be placed out of context to mean Jesus condoned violence. Jesus tells the disciples to sell their cloak for a sword showing how urgent a sword was needed at that particular time in the garden. Two swords that were shown to him obviously could not fight off the armed soldiers who came for his arrest, but he said they were enough.
Luke 22:52-53 (KJV)
52 [...] Be ye come out, as against a thief, with swords and staves?
53 When I was daily with you in the temple, ye stretched forth no hands against me: but this is your hour, and the power of darkness.
Luke 22:49 (KJV)
49 When they which were about him saw what would follow, they said unto him, Lord, shall we smite with the sword?
Jesus did not answer "No!"; he did not stop what was about to happen. Lo and behold,
Luke 22:50-51 (KJV)
50 And one of them smote the servant of the high priest, and cut off his right ear.
51 And Jesus answered and said, Suffer ye thus far. And he touched his ear, and healed him.
It was after this incident, according to John, that Jesus stopped the violence.
John 18:11 (KJV)
11 Then said Jesus unto Peter, Put up thy sword into the sheath: the cup which my Father hath given me, shall I not drink it?
This meant that if Peter succeeded in defending Him, it would hinder His death, our salvation which God had planned.
Of course the disciples wouldn't understand Him, but a little crime (2 swords) was enough to (number Him among transgressors) to fulfill Isaiah's prophecy.