This paper presents a new Web service composition method which combines the AI planning graph technique with an immune-inspired algorithm to find the optimal composition solution. Simultaneously with the planning graph construction, a matrix of semantic links is built to store the semantic links established between the services on different layers of the graph. The planning graph and the matrix of semantic links represent the main building blocks of our immune-inspired technique for finding the optimal composition solution. We use a multi-criteria function which evaluates the composition solution in terms of its QoS attributes and the quality of the semantic match between the services involved in the solution. In order to validate our approach to automatically compose Web services, we have developed an experimental framework that integrates the planning graph composition approach and the immune-inspired selection technique. We have performed our experiments on a set of Web services from two domains.