Is it possible to find same-name siblings (SNS) using SQL2, SQL, XPath or QueryBuilder in Adobe CQ5/Adobe Experience Manager. We are trying to prepare the instance for upgrade to AEM 6.X and as already known jackrabbit oak has disabled the support for SNS, which makes the upgrade without solving this problem impossible. The repository could be traversed recursively, but this is too slow and I'm looking for better options using queries. SNS are defined as follows:
/a/b/c
/a/b/c[2]
/a/b/c[3]
/a/b[2]/c[2]
/a/b/c[3]
I would prefer SQL2, but any other option is also possible. Note that no functions or xslt are possible, because we are not talking about xml documents, but for java content repository (JCR).