+ $baseURL = $this->baseUrl->get();
+
+ $xml = null;
+
+ XML::fromArray([
+ 'XRD' => [
+ '@attributes' => [
+ 'xmlns' => 'http://docs.oasis-open.org/ns/xri/xrd-1.0',
+ ],
+ 'Subject' => 'acct:' . $owner['addr'],
+ '1:Alias' => $owner['url'],
+ '2:Alias' => $alias,
+ '1:link' => [
+ '@attributes' => [
+ 'rel' => 'http://purl.org/macgirvin/dfrn/1.0',
+ 'href' => $owner['url']
+ ]
+ ],
+ '2:link' => [
+ '@attributes' => [
+ 'rel' => 'http://schemas.google.com/g/2010#updates-from',
+ 'type' => 'application/atom+xml',
+ 'href' => $owner['poll']
+ ]
+ ],
+ '3:link' => [
+ '@attributes' => [
+ 'rel' => 'http://webfinger.net/rel/profile-page',
+ 'type' => 'text/html',
+ 'href' => $owner['url']
+ ]
+ ],
+ '4:link' => [
+ '@attributes' => [
+ 'rel' => 'http://microformats.org/profile/hcard',
+ 'type' => 'text/html',
+ 'href' => $baseURL . '/hcard/' . $owner['nickname']
+ ]
+ ],
+ '5:link' => [
+ '@attributes' => [
+ 'rel' => 'http://webfinger.net/rel/avatar',
+ 'type' => $avatar['type'],
+ 'href' => User::getAvatarUrl($owner)
+ ]
+ ],
+ '6:link' => [
+ '@attributes' => [
+ 'rel' => 'http://joindiaspora.com/seed_location',
+ 'type' => 'text/html',
+ 'href' => $baseURL
+ ]
+ ],
+ '7:link' => [
+ '@attributes' => [
+ 'rel' => 'salmon',
+ 'href' => $baseURL . '/salmon/' . $owner['nickname']
+ ]
+ ],
+ '8:link' => [
+ '@attributes' => [
+ 'rel' => 'http://salmon-protocol.org/ns/salmon-replies',
+ 'href' => $baseURL . '/salmon/' . $owner['nickname']
+ ]
+ ],
+ '9:link' => [
+ '@attributes' => [
+ 'rel' => 'http://salmon-protocol.org/ns/salmon-mention',
+ 'href' => $baseURL . '/salmon/' . $owner['nickname'] . '/mention'
+ ]
+ ],
+ '10:link' => [
+ '@attributes' => [
+ 'rel' => 'http://ostatus.org/schema/1.0/subscribe',
+ 'template' => $baseURL . '/contact/follow?url={uri}'
+ ]
+ ],
+ '11:link' => [
+ '@attributes' => [
+ 'rel' => 'magic-public-key',
+ 'href' => 'data:application/magic-public-key,' . Salmon::salmonKey($owner['spubkey'])
+ ]
+ ],
+ '12:link' => [
+ '@attributes' => [
+ 'rel' => 'http://purl.org/openwebauth/v1',
+ 'type' => 'application/x-zot+json',
+ 'href' => $baseURL . '/owa'
+ ]
+ ],
+ ],
+ ], $xml);