People often conflate Scrum with Agile. But Scrum is not the same as Agile. Agile is considered by many to be a set of values, principles and way of being. Scrum is a framework consisting of roles, rules, artifacts and events. It is designed for teams to add those practices needed in order to become Agile.
XP is quite different. It is not a framework but is comprised of goals, activities, values, rules and principles. It has many of the practices that those in the Scrum community suggest be incorporated into Scrum. This is good because Scrum focuses on the framework while XP focuses on what you do and why.
Kanban has different flavors, but is essentially a method to use the principles of Lean-flow to guide a team or organization to have more agility with quality. Its focus is on achieving objectives of removing delays in workflow and feedback, increasing collaboration and realizing value quickly with high quality.
Thus, Scrum XP and Kanban all focus on different aspects of product development: Scrum-the framework, XP-the work, Kanban-the principles.
It is useful to recognize this so the best of each can be used.
Another way to see this is consider why the painting of a pipe is not a pipe.