Added system:as-user() to get the XML source of a resource.

References #388.