Implementation of an algorithm that couples nodes in XML documents