@@ -0,0 +1,2487 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one%0A *  or more contributor license agreements.  See the NOTICE file%0A *  distributed with this work for additional information%0A *  regarding copyright ownership.  The ASF licenses this file%0A *  to you under the Apache License, Version 2.0 (the%0A *  %22License%22); you may not use this file except in compliance%0A *  with the License.  You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A */%0Apackage org.codehaus.groovy.runtime;%0A%0Aimport groovy.xml.XmlUtil;%0Aimport org.w3c.dom.Element;%0Aimport org.w3c.dom.Node;%0Aimport org.w3c.dom.NodeList;%0A%0Aimport java.util.Iterator;%0A%0A/**%0A * This class defines all the new XML-related groovy methods which enhance%0A * the normal JDK XML classes when inside the Groovy environment.%0A * Static methods are used with the first parameter the destination class.%0A */%0Apublic class XmlGroovyMethods %7B%0A%0A    /**%0A     * Makes NodeList iterable by returning a read-only Iterator which traverses%0A     * over each Node.%0A     *%0A     * @param nodeList a NodeList%0A     * @return an Iterator for a NodeList%0A     * @since 1.0%0A     */%0A    public static Iterator%3CNode%3E iterator(final NodeList nodeList) %7B%0A        return new Iterator%3CNode%3E() %7B%0A            private int current /* = 0 */;%0A%0A            public boolean hasNext() %7B%0A                return current %3C nodeList.getLength();%0A            %7D%0A%0A            public Node next() %7B%0A                return nodeList.item(current++);%0A            %7D%0A%0A            public void remove() %7B%0A                throw new UnsupportedOperationException(%22Cannot remove() from a NodeList iterator%22);%0A            %7D%0A        %7D;%0A    %7D%0A%0A    /**%0A     * Transforms the element to its text equivalent.%0A     * (The resulting string does not contain a xml declaration. Use %7B@code XmlUtil.serialize(element)%7D if you need the declaration.)%0A     *%0A     * @param element the element to serialize%0A     * @return the string representation of the element%0A     * @since 2.1%0A     */%0A    public static String serialize(Element element) %7B%0A        return XmlUtil.serialize(element).replaceFirst(%22%3C%5C%5C?xml version=%5C%221.0%5C%22.*%5C%5C?%3E%22, %22%22);%0A    %7D%0A%7D

Split history main/java/org/codehaus/groovy/runtime/XmlGroovyMethods.java to main/java/org/apache/groovy/xml/extensions - resolve conflict and keep both files