add asDocument (xml) method

Change-Id: I440b71f76ff623f46bf1377c1a8e73684fc6a636