XML
<Galaxy>
<name>Milky Way</name>
<CelestialObject name="Earth" type="planet"/>
<CelestialObject name="Sun" type="star"/>
</Galaxy>
XPATH
/Galaxy/*[@name]
or
//*[@name]
OUTPUT
<CelestialObject name="Earth" type="planet" />
<CelestialObject name="Sun" type="star" />