Modified to work with Xross Entity Map (thexem.de)