This prayer of Jesus is first of all for himself, for his disciples, and for the world via his disciples.
There are three parts of John 17.
Verses 1- 5 Jesus prays for Himself:
These words spake Jesus, and lifted up his eyes to heaven, and said, Father, the hour is come; glorify thy Son, that thy Son also may glorify thee: As thou hast given him power over all flesh, that he should give eternal life to as many as thou hast given him. And this is life eternal, that they might know thee the only true God, and Jesus Christ, whom thou hast sent. I have glorified thee on the earth: I have finished the work which thou gavest me to do. And now, O Father, glorify thou me with thine own self with the glory which I had with thee before the world was.
Verses 6 - 19: Jesus prays only for His Disciples (the transition is in verse 20):
I have manifested thy name unto the men which thou gavest me out of the world: thine they were, and thou gavest them me; and they have kept thy word. Now they have known that all things whatsoever thou hast given me are of thee. For I have given unto them the words which thou gavest me; and they have received them, and have known surely that I came out from thee, and they have believed that thou didst send me. I pray for them: I pray not for the world, but for them which thou hast given me; for they are thine. And all mine are thine, and thine are mine; and I am glorified in them. And now I am no more in the world, but these are in the world, and I come to thee. Holy Father, keep through thine own name those whom thou hast given me, that they may be one, as we are. While I was with them in the world, I kept them in thy name: those that thou gavest me I have kept, and none of them is lost, but the son of perdition; that the scripture might be fulfilled. And now come I to thee; and these things I speak in the world, that they might have my joy fulfilled in themselves. I have given them thy word; and the world hath hated them, because they are not of the world, even as I am not of the world. I pray not that thou shouldest take them out of the world, but that thou shouldest keep them from the evil. They are not of the world, even as I am not of the world. Sanctify them through thy truth: thy word is truth. As thou hast sent me into the world, even so have I also sent them into the world. And for their sakes I sanctify myself, that they also might be sanctified through the truth. (verses 16 - 17)
Verses 20 - 25 - Verse 20 is the transition Verse. Jesus says His prayer is not for them alone which indicates a second part of His Prayer was for the disciples only and their safety.
Third part: Jesus says that it is His desire that the world believe.
(20 - 21) 20 Neither pray I for these alone, but for them also which shall believe on me through their word;
21 That they all may be one; as thou, Father, art in me, and I in thee, that they also may be one in us: that the world may believe that thou hast sent me.
Again, His reference to "those you have given Me" is a reference of the disciples. He wants them (us) to take His message of His being the only begotten Son of God to the world.
(22) I have given them the glory that you gave me, that they may be one as we are one: (23) I in them and you in me. May they be brought to complete unity to let the world know that you sent me and have loved them even as you have loved me.
Verses 23 -26: Jesus Said: I in them, and thou in me, that they may be made perfect in one; and that the world may know that thou hast sent me, and hast loved them, as thou hast loved me. Father, I will that they also, whom thou hast given me, be with me where I am; that they may behold my glory, which thou hast given me: for thou lovedst me before the foundation of the world. O righteous Father, the world hath not known thee: but I have known thee, and these have known that thou hast sent me. And I have declared unto them thy name, and will declare it: that the love wherewith thou hast loved me may be in them, and I in them.