How to get page-source of an element?

Hi everyone,

Is it possible to get the page-source of a single element?
What i want is just the pagesource of an element of a native app. I have googled allot and found that its possible for webpages but did not get any solution for mobile’s native app.
like below examples.

elem.getAttribute("innerHTML");

OR

WebElement element = driver.findElement(By.id("foo"));
String contents = (String)((JavascriptExecutor)driver).executeScript("return arguments[0].innerHTML;", element);