Is there a way to access and handle the tags/element already present into a

Is there a way to access and handle the tags/element already present into an svg file loaded with the following?
Image img = new Image("name", "path")

My goal is to show an svg image and make it interactive, i.e. change the colour of a element when a server-side event triggers.
The file i’d like to interact to is like

<svg ....> 
  ..some stuff..
  <text id="LABEL_ID" x="715.7" y="227">TextToShow</text>
  <rect id="RECT_ID" height="70" width="84.85714" y="104" x="148"/>
</svg>

and change the attributes of the element programmatically.

Thank you