title: Generate XPath for each node in XML, using custom attribute (name in this case)
body: <p>I have a huge XML file, that look like this (but is much larger):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;suite id="1" name="SuiteName"&gt;
    &lt;displayNameKey&gt;something&lt;/displayNameKey&gt;
    &lt;displayName&gt;something&lt;/displayName&gt;
    &lt;application id="2" name="Manager"&gt;
      &lt;displayNameKey&gt;appName&lt;/displayNameKey&gt;
      &lt;displayName&gt;appName&lt;/displayName&gt;
      &lt;category id="12" name="navigation"&gt;
        &lt;displayNameKey&gt;managerNavigation&lt;/displayNameKey&gt;
        &lt;displayName&gt;managerNavigation&lt;/displayName&gt;
        &lt;description&gt;mgr_navigation&lt;/description&gt;
        &lt;property id="13" name="httpPort" type="integer_property" width="40"&gt;
          &lt;displayNameKey&gt;managerHttpPort&lt;/displayNameKey&gt;
          &lt;displayName&gt;managerHttpPort&lt;/displayName&gt;
          &lt;value&gt;80&lt;/value&gt;
        &lt;/property&gt;
        &lt;property id="14" name="httpsPort" type="integer_property" width="40"&gt;
          &lt;displayNameKey&gt;managerHttpsPort&lt;/displayNameKey&gt;
          &lt;displayName&gt;managerHttpsPort&lt;/displayName&gt;
          &lt;value&gt;443&lt;/value&gt;
        &lt;/property&gt;
        &lt;property id="15" name="welcomePageURI" type="url_property" width="40" hidden="true"&gt;
          &lt;displayNameKey&gt;welcomePageURI&lt;/displayNameKey&gt;
          &lt;displayName&gt;welcomePageURI&lt;/displayName&gt;
          &lt;value&gt;jsp/index.jsp&lt;/value&gt;
        &lt;/property&gt;
        &lt;property id="16" name="serverURL" type="url_property" width="40"&gt;
          &lt;displayNameKey&gt;serverURL&lt;/displayNameKey&gt;
          &lt;displayName&gt;serverURL&lt;/displayName&gt;
          &lt;value&gt;somevalue&lt;/value&gt;
        &lt;/property&gt;
      &lt;/category&gt;
      &lt;category id="17" name="datafiltering"&gt;
        &lt;displayNameKey&gt;managerDataFiltering&lt;/displayNameKey&gt;
        &lt;displayName&gt;managerDataFiltering&lt;/displayName&gt;
        &lt;description&gt;mgr_data_filtering&lt;/description&gt;
        &lt;property id="18" name="defaultTableName" type="string_property" width="40"&gt;
          &lt;displayNameKey&gt;defaultTableName&lt;/displayNameKey&gt;
          &lt;displayName&gt;defaultTableName&lt;/displayName&gt;
        &lt;/property&gt;
        &lt;property id="19" name="defaultAudienceName" type="string_property" width="40"&gt;
          &lt;displayNameKey&gt;defaultAudienceName&lt;/displayNameKey&gt;
          &lt;displayName&gt;defaultAudienceName&lt;/displayName&gt;
        &lt;/property&gt;
      &lt;/category&gt;
    &lt;/application&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>What I need to do is generate an XPath expression for each property but not using positions or IDs, but name attribute.
  That is, for the file above the desired output is similar to:</p>
  
  <pre><code>/suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="navigation"]/property[@name="httpPort"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="navigation"]/property[@name="httpsPort"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="navigation"]/property[@name="welcomePageURI"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="navigation"]/property[@name="serverURL"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="datafiltering"]/property[@name="defaultTableName"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="datafiltering"]/property[@name="defaultAudienceName"]
  </code></pre>
  
  <p>All XPath generators I found only generate XPath using name attribute or position, such as /suite[0]/application[0]/category[1]/...</p>
  
  <p>Can you please recommend me a way how to generate XPaths for all properties in my file?
  And one more thing - the structure is variable - that is there can be 0 to N nested categories, such as</p>
  
  <pre><code>/suite[@name="SuiteName"]/application[@name="Manager"]/category[@name="cat1"]/category[@name="cat2"]/category[@name="cat3"]/property[@name="property1"]
  /suite[@name="SuiteName"]/application[@name="Manager"]/property[@name="property2"]
  </code></pre>