Parsing XML from VLC XSPF

Trying to read and eventually alter and write a VLC playlist file as XSPF.
Below is an attempt to read the bookmarks entry.
But the docs say an attribute should not contain multiple values, so I guess its not the standard way to do it.

<vlc:option>bookmarks={name=BM Name 01,time=840.785},{name=BM Name 2,time=1846.624}</vlc:option>

I can get the “text” but not sure what to do after that to keep it so I can alter and write it back.
VLC help page
note: there are cases when options may contain other things.

<vlc:option>bookmarks={name=BM Name 1,time=1559.467},{name=BM Name 2,time=2646.217}</vlc:option>
<vlc:option>start-time=42</vlc:option>
<vlc:option>stop-time=45</vlc:option>
<vlc:option>no-audio</vlc:option>

this code doesnt work.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set theXmlText to "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<playlist xmlns=\"http://xspf.org/ns/0/\" xmlns:vlc=\"http://www.videolan.org/vlc/playlist/ns/0/\" version=\"1\">
	<title>Playlist</title>
	<trackList>
		<track>
			<location>file:///Volumes/WD_3TB/Documents_Ext/_Library/Video%20Training/Giving%20your%20AppleScripts%20a%20Face%20Lift%20with%20AppleScriptObjC%20-%20Ben%20Waldie/Giving%20your%20AppleScripts%20a%20Face%20Lift%20with%20AppleScriptObjC%20-%20Ben%20Waldie%20-%20YouTube.mp4</location>
			<duration>4441234</duration>
			<extension application=\"http://www.videolan.org/vlc/playlist/0\">
				<vlc:id>0</vlc:id>
				<vlc:option>bookmarks={name=BM Name 1,time=1559.467},{name=BM Name 2,time=2646.217}</vlc:option>
			</extension>
		</track>
		<track>
			<location>file:///Volumes/WD_3TB/Documents_Ext/_Library/Video%20Training/Mac%20Admins%20Conference/From%20Idea%20to%20Script%20to%20App_%20A%20Beginners%20Journey%20in%20macOS%20App%20Development.mp4</location>
			<duration>2948585</duration>
			<extension application=\"http://www.videolan.org/vlc/playlist/0\">
				<vlc:id>1</vlc:id>
				<vlc:option>bookmarks={name=BM Name 01,time=840.785},{name=BM Name 2,time=1846.624}</vlc:option>
				<vlc:option>start-time=42</vlc:option>
			</extension>
		</track>
	</trackList>
	<extension application=\"http://www.videolan.org/vlc/playlist/0\">
		<vlc:item tid=\"0\"/>
		<vlc:item tid=\"1\"/>
	</extension>
</playlist>
"

set {theXMLDoc, theError} to current application's NSXMLDocument's alloc()'s initWithXMLString:theXmlText options:0 |error|:(reference)

--<vlc:option>bookmarks={name=BM Name 01,time=840.785},{name=BM Name 2,time=1846.624}</vlc:option>

set {theMatches, theError} to (theXMLDoc's nodesForXPath:"//track/extension/vlc:option" |error|:(reference))
--(NSArray) {
--	(NSXMLElement) <vlc:option>bookmarks={name=BM Name 1,time=1559.467},{name=BM Name 2,time=2646.217}</vlc:option>,
--	(NSXMLElement) <vlc:option>bookmarks={name=BM Name 01,time=840.785},{name=BM Name 2,time=1846.624}</vlc:option>
--	(NSXMLElement) <vlc:option>start-time=42</vlc:option>
--}

--set {theMatches, theError} to (theXMLDoc's nodesForXPath:"//track/extension/vlc:option/text()" |error|:(reference))
--(NSXMLNode) bookmarks={name=BM Name 1,time=1559.467},{name=BM Name 2,time=2646.217}

if theMatches = missing value then error (theError's localizedDescription() as text)
set theResult to {}
repeat with aMatch in theMatches
	set end of theResult to {(aMatch's attributeForName:"vlc:option/@bookmarks")'s stringValue() as text, aMatch's stringValue() as text}
end repeat
return theResult

In that sample, bookmarks is not an attribute, it’s just part of the stringValue. If it were an an attribute, it would begin <vlc:option bookmarks=.