Хотя ответ @ Флэка правильный, желаемый результат может быть получен с помощью одного выражения XPath:
concat('
', /*/account[@id=15]/@first_name,
' ', /*/account[@id=15]/@last_name,
' : ', /*/account[@id=15]/profile_employee/address/@building,
'/', /*/account[@id=15]/profile_employee/address/@room
)
Когда это выражение XPath оценивается в предоставленном XML-документе :
<root>
<account id="15" first_name="Sandra" last_name="Schlichting">
<private_address address_id="19" />
<profile_employee fk_id="15">
<date_created>2011-1-2T1:1:00</date_created>
<address building="3" room="2" floor="1" />
</profile_employee>
<profile_student fk_id="15">
<address address_id="19" />
</profile_student>
<profile_student fk_id="15">
<address address_id="45" />
</profile_student>
</account>
</root>
желаемый, правильный результат получается:
Sandra Schlichting : 3/2