// Path: plugin/src/main/java/com/itemis/maven/plugins/unleash/util/functions/ProjectToString.java
// public enum ProjectToString implements Function<MavenProject, String> {
//   /**
//    * The default instance which prints the groupId, artifactId and the version.
//    */
//   INSTANCE(false, true),
//   /**
//    * An instance which uses the groupId, the artifactId, the version and the packaging of the artifact.
//    */
//   INCLUDE_PACKAGING(true, true),
//   /**
//    * An instance which only prints the groupId and the artifactId.
//    */
//   EXCLUDE_VERSION(false, false);
// 
//   private boolean includePackaging;
//   private boolean includeVersion;
// 
//   private ProjectToString(boolean includePackaging, boolean includeVersion) {
//     this.includePackaging = includePackaging;
//     this.includeVersion = includeVersion;
//   }
// 
//   @Override
//   public String apply(MavenProject p) {
//     StringBuilder sb = new StringBuilder(p.getGroupId());
//     sb.append(":").append(p.getArtifactId());
//     if (this.includePackaging && p.getPackaging() != null) {
//       sb.append(":").append(p.getPackaging());
//     }
//     if (this.includeVersion && p.getVersion() != null) {
//       sb.append(":").append(p.getVersion());
//     }
//     return sb.toString();
//   }
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import com.google.common.base.Joiner;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.project.MavenProject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.StandardSystemProperty;
import com.google.common.io.Closeables;
import com.itemis.maven.plugins.unleash.util.functions.ProjectToString;
   * Queries a node for a child with a specific name.
   *
   * @param parentNode the parent to query for the node.
   * @param nodeName the name of the searched node.
   * @return {@code true} if the parent contains a node with the specified name.
   */
  public static boolean hasChildNode(Node parentNode, String nodeName) {
    NodeList children = parentNode.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node n = children.item(i);
      if (Objects.equal(nodeName, n.getNodeName())) {
        return true;
      }
    }
    return false;
  }

  /**
   * Get the text content of a specified child node (the first one) if it is present.
   *
   * @param parentNode the parent to query for the node.
   * @param nodeName the name of the child node from which the text content is requested.
   * @return the text content of the searched node.
   */
  public static Optional<String> getChildNodeTextContent(Node parentNode, String nodeName) {
    String value = null;

    NodeList children = parentNode.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node n = children.item(i);
// Path: plugin/src/main/java/com/itemis/maven/plugins/unleash/util/functions/ProjectToString.java
// public enum ProjectToString implements Function<MavenProject, String> {
//   /**
//    * The default instance which prints the groupId, artifactId and the version.
//    */
//   INSTANCE(false, true),
//   /**
//    * An instance which uses the groupId, the artifactId, the version and the packaging of the artifact.
//    */
//   INCLUDE_PACKAGING(true, true),
//   /**
//    * An instance which only prints the groupId and the artifactId.
//    */
//   EXCLUDE_VERSION(false, false);
// 
//   private boolean includePackaging;
//   private boolean includeVersion;
// 
//   private ProjectToString(boolean includePackaging, boolean includeVersion) {
//     this.includePackaging = includePackaging;
//     this.includeVersion = includeVersion;
//   }
// 
//   @Override
//   public String apply(MavenProject p) {
//     StringBuilder sb = new StringBuilder(p.getGroupId());
//     sb.append(":").append(p.getArtifactId());
//     if (this.includePackaging && p.getPackaging() != null) {
//       sb.append(":").append(p.getPackaging());
//     }
//     if (this.includeVersion && p.getVersion() != null) {
//       sb.append(":").append(p.getVersion());
//     }
//     return sb.toString();
//   }
// }


// Path: plugin/src/main/java/com/itemis/maven/plugins/unleash/util/PomUtil.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import com.google.common.base.Joiner;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Parent;
import org.apache.maven.project.MavenProject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.StandardSystemProperty;
import com.google.common.io.Closeables;
import com.itemis.maven.plugins.unleash.util.functions.ProjectToString;

   * Queries a node for a child with a specific name.
   *
   * @param parentNode the parent to query for the node.
   * @param nodeName the name of the searched node.
   * @return {@code true} if the parent contains a node with the specified name.
   */
  public static boolean hasChildNode(Node parentNode, String nodeName) {
    NodeList children = parentNode.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node n = children.item(i);
      if (Objects.equal(nodeName, n.getNodeName())) {
        return true;
      }
    }
    return false;
  }

  /**
   * Get the text content of a specified child node (the first one) if it is present.
   *
   * @param parentNode the parent to query for the node.
   * @param nodeName the name of the child node from which the text content is requested.
   * @return the text content of the searched node.
   */
  public static Optional<String> getChildNodeTextContent(Node parentNode, String nodeName) {
    String value = null;

    NodeList children = parentNode.getChildNodes();
    for (int i = 0; i < children.getLength(); i++) {
      Node n = children.item(i);
      if (Objects.equal(nodeName, n.getNodeName())) {