With the advent of IoT, storing, indexing and querying XML data efficiently is critical. To minimize the cost of querying XML data, researchers have proposed many indexing techniques. Nearly all the techniques, partition the XML data into a number of data-streams. To evaluate a query, existing twig pattern matching algorithms process a subset of the data-streams simultaneously. Processing many data-streams simultaneously results in some or all of the following four problems, namely, the accessing of many data nodes which don’t appear in the final solution of a given query, the generation of duplicate results, the generation of huge number of intermediate results, and the cost of merging the generated intermediate results. To the best of our knowledge, all the existing twig pattern matching algorithms suffer from some or all of the above mentioned problems. This paper proposes a new twig pattern matching algorithm called MatchQTP which processes one data-stream at a time and avoids all the above mentioned four problems. It also proposes a new indexing technique called RLP-Index and a new XML node labeling scheme called RLP-Scheme, both of which are used by MatchQTP. Unlike the existing indexing techniques, RLP-Index stores a subset of the data nodes. The rest of the data nodes can be generated efficiently. This minimizes storage space utilization and query processing time and makes RLP-Index the first of its kind. Many experiments were conducted to study the performance of MatchQTP. The results show that MatchQTP is very efficient and highly scalable. It was also compared with four algorithms, three of which are used frequently in the literature to compare the performance of new algorithms and the fourth algorithm is the state-of-the-art algorithm. MatchQTP significantly and consistently outperformed all of them