Это XQuery:
element result {
for $game in /games/game[tokenize(Platform,',')[2]]
return element game {
$game/(ID|Name|Publisher|Platform)
}
}
С этим входом:
<games>
<game>
<ID>B003JVKHEQ</ID>
<Name>Duty</Name>
<Publisher>AC</Publisher>
<ESRB>M</ESRB>
<Motion>False</Motion>
<Platform>Playstation3,XBox</Platform>
</game>
</games>
Выход:
<result>
<game>
<ID>B003JVKHEQ</ID>
<Name>Duty</Name>
<Publisher>AC</Publisher>
<Platform>Playstation3,XBox</Platform>
</game>
</result>
Редактировать : с буквальным результатомэлементы
<result>{
for $game in /games/game[tokenize(Platform,',')[2]]
return <game>{
$game/(ID|Name|Publisher|Platform)
}</game>
}</result>