I can not reproduce this issue, either by trying your example query in the workbench or by programmatically executing it and serializing the result to RDF/XML.
Can you give me some more details about the exact circumstances in which this problem occurs?