XPath uses database retrieves/constraints AFAIK, so it might be causing issues since your 'new' object isn't committed to the database yet?
Thanx Paul for your answer.
It seems like the Google Maps sample snippets and microflows don't commit either and that seems to work just fine. Could it be something else or do I really first have to commit? In lots of situations I can imagine you don't want to commit, so I hope there is another solution.