If anybody needs to initialize an ObjectSpaceProvider with XPO for UnitTesting or a ServiceApplication here is the code:

public IObjectSpaceProvider CreateObjectSpaceProvider(Assembly assembly, string connectionString)
    var dictionary = new ReflectionDictionary();
    var info = new TypesInfo();
    var source = new XpoTypeInfoSource(info, dictionary);
    foreach (XPClassInfo item in dictionary.Classes)
    return new XPObjectSpaceProvider(new ConnectionStringDataStoreProvider(connectionString), info, source);

This took me hours of digging in the XAF-source.

Hope this helps anyone.

Happy coding, Manuel!