code: public static XPath parse(String xpath) throws IllegalArgumentException {
          XPath xp = new XPath();
  
          // save the xpath as the full xpath
          xp.fullXPath = xpath;
          
          // does the xpath end with /*
          if (xpath.length() >= 2 && xpath.endsWith("/*")) {
              xp.includeChildren = true;
              xpath = xpath.substring(0, xpath.length()-2);
          }
  
          // normalized path is the rest
          xp.normalizedXPath = xpath;
  
          return xp;
      }
docs: Parses an XPath and returns its representation as an object.  Only a subset
  of XPath queries are supported.  Valid queries are:<br><br>
  /<br>
  /*<br>
  /nodeA<br>
  /nodeA/*<br>
  
  @param xpath
  @return
  @throws java.lang.IllegalArgumentException