To repair your tools or armor, simply insert a damaged item with Mending into the first slot of an experience tank. The item will be repaired 2 durability per experience point (1 unit of xp) at a maximum of 32 durability per processing cycle.
Experience Tank repairing an elytra
Technical Details
Experience tanks are processed every 16 gameticks (0.8 seconds or 8 redstone ticks), meaning that an item can be repaired at most by 40 durability per second.