1. Create a XmlTest instance.
2. Invoke org.testng.internal.annotations.AnnotationHelper#findMethodsWithAnnotation [ here you can pass an instance of JDK15AnnotationFinder() for IAnnotationFinder)
3. Now from the ITestNGMethod[] array build Set<ITestClass> (just to ensure we get only the unique classes.
4. Now invoke org.testng.internal.MethodGroupsHelper#findGroupsMethods with the Set<ITestClass> obtained from (3) and false [ so that we get all beforeXXX methods that are part of your group ]
5. Repeat step (4) with false [so that we get all afterXXX methods that are part of your group ]
The map that you get from (4) and (5) essentially would hold the details that you are looking for.