// Path: src/main/java/org/dynaform/xml/XmlVisitor.java
// public interface XmlVisitor {
// 
//   /**
//    * Handle text.
//    * 
//    * @param s text.
//    * @return XML event handler to be used as next.
//    */
//   XmlVisitor text(String s);
// 
//   /**
//    * Handle XML element start.
//    * 
//    * @param element name of the XML element.
//    * @return event handler for the XML element.
//    */
//   ElementVisitor visitElement(String element);
//   
//   /**
//    * Handle end of the XML element body.
//    * 
//    * @return event handler of the XML element to be used as next.
//    */
//   ElementVisitor visitEndBody();
// 
//   /**
//    * Event handler of XML element.
//    * 
//    * @author Rein Raudjärv
//    */
//   interface ElementVisitor {
//     /**
//      * Handle XML attribute.
//      * 
//      * @param name name of the XML attribute.
//      * @param value value of the XML attribute.
//      * @return event handler for the XML element.
//      */
//     ElementVisitor visitAttribute(String name, String value);
// 
//     /**
//      * Handle start of the XML body.
//      * 
//      * @return event handler for the XML element body.
//      */
//     XmlVisitor visitBody();
// 
//     /**
//      * Handle end of the XML element.
//      * 
//      * @return XML event handler to be used as next.
//      */
//     XmlVisitor visitEndElement();
//   }
// 
// }


import org.dynaform.xml.XmlVisitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

package org.dynaform.xml.writer;



/**
 * @author Rein Raudjärv
 * 
 * @see XmlWriter
 */
public class SequenceWriter implements XmlWriter {

	private final Collection<XmlWriter> children;
	
	public static XmlWriter newInstance(Collection<XmlWriter> writers) {
		if (writers == null || writers.isEmpty())

// Path: src/main/java/org/dynaform/xml/XmlVisitor.java
// public interface XmlVisitor {
// 
//   /**
//    * Handle text.
//    * 
//    * @param s text.
//    * @return XML event handler to be used as next.
//    */
//   XmlVisitor text(String s);
// 
//   /**
//    * Handle XML element start.
//    * 
//    * @param element name of the XML element.
//    * @return event handler for the XML element.
//    */
//   ElementVisitor visitElement(String element);
//   
//   /**
//    * Handle end of the XML element body.
//    * 
//    * @return event handler of the XML element to be used as next.
//    */
//   ElementVisitor visitEndBody();
// 
//   /**
//    * Event handler of XML element.
//    * 
//    * @author Rein Raudjärv
//    */
//   interface ElementVisitor {
//     /**
//      * Handle XML attribute.
//      * 
//      * @param name name of the XML attribute.
//      * @param value value of the XML attribute.
//      * @return event handler for the XML element.
//      */
//     ElementVisitor visitAttribute(String name, String value);
// 
//     /**
//      * Handle start of the XML body.
//      * 
//      * @return event handler for the XML element body.
//      */
//     XmlVisitor visitBody();
// 
//     /**
//      * Handle end of the XML element.
//      * 
//      * @return XML event handler to be used as next.
//      */
//     XmlVisitor visitEndElement();
//   }
// 
// }


// Path: src/main/java/org/dynaform/xml/writer/SequenceWriter.java
import org.dynaform.xml.XmlVisitor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

package org.dynaform.xml.writer;



/**
 * @author Rein Raudjärv
 * 
 * @see XmlWriter
 */
public class SequenceWriter implements XmlWriter {

	private final Collection<XmlWriter> children;
	
	public static XmlWriter newInstance(Collection<XmlWriter> writers) {
		if (writers == null || writers.isEmpty())

			return null;
