xpath Search for nodes with name as Light, Device or Sensor


Example

XML

<Galaxy>
    <Light>sun</Light>
    <Device>satellite</Device>
    <Sensor>human</Sensor>
    <Name>Milky Way</Name>
</Galaxy>

XPATH

/Galaxy/*[local-name()='Light' or local-name()='Device' or local-name()='Sensor']

or

//*[local-name()='Light' or local-name()='Device' or local-name()='Sensor']

OUTPUT

<Light>sun</Light>
<Device>satellite</Device>
<Sensor>human</Sensor>