Further attempt was to use
X-DOKUWIKI-DO (
https://www.dokuwiki.org/export )
I had to figure how to set it, $_SERVER['HTTP_X_DOKUWIKI_DO'], seems to do it.
However, when including the page, it also exits the php code, which means rest of the page isn't read.
So, another way is to simply use fopen:
$exported_page = file_get_contents('http://.../wiki/doku.php?id=article:1&do=export_xhtmlbody');
... seems to do it.