diff --git a/misc/xgen/.gitignore b/misc/xgen/.gitignore
new file mode 100644
index 0000000..75472cf
--- /dev/null
+++ b/misc/xgen/.gitignore
@@ -0,0 +1,4 @@
+/target/
+/.classpath
+/.settings/
+/.project
diff --git a/misc/xgen/pom.xml b/misc/xgen/pom.xml
new file mode 100644
index 0000000..982920a
--- /dev/null
+++ b/misc/xgen/pom.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<parent>
+		<groupId>org.onap.aaf.misc</groupId>
+		<artifactId>parent</artifactId>
+		<version>1.3.0-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>aaf-misc-xgen</artifactId>
+	<name>AAF Misc XGen</name>
+	<packaging>jar</packaging>
+
+	<developers>
+		<developer>
+			<name>Jonathan Gathman</name>
+			<email>jonathan.gathman@att.com</email>
+			<organization>ATT</organization>
+			<roles>
+				<role>Architect</role>
+				<role>Lead Developer</role>
+			</roles>
+		</developer>
+		<developer>
+			<name>Gabe Maurer</name>
+			<email>gabe.maurer@att.com</email>
+			<organization>ATT</organization>
+			<roles>
+				<role>Developer</role>
+			</roles>
+		</developer>
+		<developer>
+			<name>Ian Howell</name>
+			<email>ian.howell@att.com</email>
+			<organization>ATT</organization>
+			<roles>
+				<role>Developer</role>
+			</roles>
+		</developer>
+	</developers>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.onap.aaf.misc</groupId>
+			<artifactId>aaf-misc-env</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+	</dependencies>
+	<!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> 
+		<artifactId>maven-deploy-plugin</artifactId> <version>2.6</version> <configuration> 
+		<skip>false</skip> </configuration> </plugin> </plugins> </build> <distributionManagement> 
+		<repository> <id>nexus</id> <name>attarch-releases</name> <url>http://mavencentral.it.att.com:8084/nexus/content/repositories/attarch-releases</url> 
+		</repository> <snapshotRepository> <id>nexus</id> <name>attarch-snapshots</name> 
+		<url>http://mavencentral.it.att.com:8084/nexus/content/repositories/attarch-snapshots</url> 
+		</snapshotRepository> </distributionManagement> -->
+</project>
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Back.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Back.java
new file mode 100644
index 0000000..71c10aa
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Back.java
@@ -0,0 +1,34 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+public class Back {
+	public String str;
+	public boolean dec;
+	public boolean cr;
+	
+	public Back(String string, boolean decrement, boolean newline) {
+		str = string;
+		dec = decrement;
+		cr = newline;
+	}
+}
\ No newline at end of file
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Cache.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Cache.java
new file mode 100644
index 0000000..2a9ee67
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Cache.java
@@ -0,0 +1,37 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+
+public interface Cache<G extends XGen<G>> {
+	public void dynamic(G hgen, Code<G> code);
+	
+	public static class Null<N extends XGen<N>> implements Cache<N> {
+		@Override
+		public void dynamic(N hgen, Code<N> code) {} // NO_OP, no matter what type
+
+		@SuppressWarnings("rawtypes")
+		private static Null<?> singleton = new Null();
+		public static Null<?> singleton() { return singleton;}
+	}
+
+}
\ No newline at end of file
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java
new file mode 100644
index 0000000..aa3d1fe
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java
@@ -0,0 +1,131 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.misc.env.Trans;
+import org.onap.aaf.misc.xgen.html.State;
+import org.onap.aaf.misc.xgen.html.Thematic;
+
+
+public abstract class CacheGen<G extends XGen<G>> {
+	public static final int NO_FLAGS = 0x0;
+	public final static int PRETTY	= 0x1;
+	public final static int XML		= 0x2;
+	public final static int HTML4 	= 0x4;
+	public final static int HTML5 	= 0x8;
+
+	
+	private ArrayList<Section<G>> sections = new ArrayList<Section<G>>();
+	private int flags;
+	private final Thematic thematic;
+
+	public CacheGen(int flags, Code<G> code) throws APIException, IOException {
+		this.flags = flags;
+		final XGenBuff<G> buff = new XGenBuff<G>(flags,this);
+		// Run to gather Strings and Code Class Segments
+		buff.run(new Cache<G>() {
+				@Override
+				public void dynamic(G hgen, Code<G> code) {
+					sections.add(buff.newSection());
+					sections.add(new Dynamic(hgen.getIndent(),code));
+				}
+			},code);
+		sections.add(buff.newSection());
+	
+		// If Code implements thematic, set for later
+		thematic = code instanceof Thematic?(Thematic)code:null;
+
+	}
+	
+	public abstract G create(int htmlStyle, Writer w);
+
+	public void replay(State<Env> state, Trans trans, OutputStream os, String theme) throws IOException, APIException {
+		replay(state, trans, new OutputStreamWriter(os), theme);
+	}
+	
+	public void replay(State<Env> state, Trans trans,Writer w, String theme) throws IOException, APIException {
+		if(thematic!=null) {
+			theme = thematic.themeResolve(theme);
+		}
+		/* Theme
+		trans.setTheme(theme);
+		int htmlStyle = state.htmlVer(theme);
+		*/
+		
+		XGenBuff<G> buff = new XGenBuff<G>(flags,this);
+		
+		// forward
+		int indent = 0;
+		Section<G> s;
+		int i=0;
+		@SuppressWarnings("unchecked")
+		Section<G>[] reverse = new Section[sections.size()];
+		for(Section<G> section : sections) {
+			s = section.use(state, trans, buff); // note, doesn't change cached, only dynamic, which is created for thread
+			int tempIndent = s.getIndent();
+			s.setIndent(indent);
+			s.forward(w);
+			s.setIndent(tempIndent);
+			indent = tempIndent;
+			reverse[i++]=s;
+		}
+
+		for(--i;i>=0;--i) {
+			reverse[i].back(w);
+		}
+		w.flush();
+	}
+	
+	private class Dynamic extends Section<G> {
+		private Code<G> code;
+		
+		public Dynamic(int indent, Code<G> code) {
+			this.code = code;
+			this.indent = indent;
+		}
+
+		@SuppressWarnings("unchecked")
+		public Section<G> use(State<Env> state, Trans trans, XGenBuff<G> buff) throws APIException, IOException {
+			// Clone Dynamic to make Thread Safe
+			Dynamic d = new Dynamic(indent,code);
+			buff.setIndent(indent);
+			if(code instanceof DynamicCode) {
+				buff.run(state,trans,Cache.Null.singleton(), (DynamicCode<G,?,? extends Trans>)code);
+			} else {
+				buff.run((Cache<G>)Cache.Null.singleton(), code);
+			}
+			Section<G> s = buff.newSection();
+			d.indent = s.indent;
+			d.forward = s.forward;
+			d.backward = s.backward;
+			return d;
+		}
+	}
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Code.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Code.java
new file mode 100644
index 0000000..96418df
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Code.java
@@ -0,0 +1,30 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.IOException;
+
+import org.onap.aaf.misc.env.APIException;
+
+public interface Code<G extends XGen<G>> {
+	public void code(Cache<G> cache, G xgen) throws APIException, IOException;
+}
\ No newline at end of file
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/DynamicCode.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/DynamicCode.java
new file mode 100644
index 0000000..1b798fb
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/DynamicCode.java
@@ -0,0 +1,44 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.IOException;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.misc.env.Trans;
+import org.onap.aaf.misc.xgen.html.State;
+
+/**
+ * Special Code Interface to gain access to Transaction
+ * and State information
+ * @author Jonathan
+ *
+ */
+public abstract class DynamicCode<G extends XGen<G>, AS extends State<Env>, TRANS extends Trans> implements Code<G> {
+	public abstract void code(final AS state, final TRANS trans, final Cache<G> cache, final G xgen) throws APIException, IOException;
+	
+	// We expect not to have this section of the code engaged at any time
+	public void code(final Cache<G> cache, final G xgen) throws APIException, IOException {
+		code(null, null,cache,xgen);
+	}
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Mark.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Mark.java
new file mode 100644
index 0000000..92dc5b9
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Mark.java
@@ -0,0 +1,40 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+public class Mark {
+	// package on purpose
+	int spot = 0;
+	public String comment;
+	
+	public Mark() {
+		comment = null; 
+	}
+	
+	public Mark(String string) {
+		comment = string;
+	}
+
+	public void spot(int spot) {
+		this.spot = spot;
+	}
+}
\ No newline at end of file
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Section.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Section.java
new file mode 100644
index 0000000..8eb98ff
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/Section.java
@@ -0,0 +1,61 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.misc.env.Trans;
+import org.onap.aaf.misc.xgen.html.State;
+
+public class Section<G extends XGen<G>> {
+	protected int indent;
+	protected String forward;
+	protected String backward;
+	
+	// Default is to use the set Strings (static) 
+	public Section<G> use(State<Env> state, Trans trans, XGenBuff<G> buff) throws APIException, IOException {
+		return this;
+	}
+	
+	public int getIndent() {
+		return indent;
+	}
+
+	public void setIndent(int indent) {
+		this.indent = indent;
+	}
+
+	public void forward(Writer w) throws IOException {
+		w.write(forward);
+	}
+	
+	public void back(Writer w) throws IOException {
+		w.write(backward);
+	}
+	
+	public String toString() {
+		return forward;
+	}
+}
\ No newline at end of file
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java
new file mode 100644
index 0000000..09c0311
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGen.java
@@ -0,0 +1,296 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.PrintWriter;
+import java.io.Writer;
+import java.util.Stack;
+
+import org.onap.aaf.misc.env.util.IndentPrintWriter;
+import org.onap.aaf.misc.env.util.StringBuilderWriter;
+
+public class XGen<RT extends XGen<RT>> {
+
+	public static int COMMENT_COLUMN = 40;
+	private StringBuilder backSB = new StringBuilder();
+	private Stack<Back> backStack = new Stack<Back>();
+	
+	protected XGen(Writer w) {
+		forward = new IndentPrintWriter(w);
+	}
+
+	public int pushBack(Back b) {
+		int rv = backStack.size();
+		backStack.push(b);
+		return rv;
+	}
+
+	public boolean pretty = false;
+	protected IndentPrintWriter forward;
+
+	public IndentPrintWriter getWriter() {
+		return forward;
+	}
+
+	protected PrintWriter back = new PrintWriter(
+				new StringBuilderWriter(backSB));
+
+	@SuppressWarnings("unchecked")
+	public RT pretty() {
+		pretty = true;
+		return (RT) this;
+	}
+
+	protected void prettyln(PrintWriter pw) {
+		if(pretty)pw.println();
+	}
+
+	public RT leaf(Mark mark, String tag, String ... args) {
+		mark.spot = backStack.size();
+		return leaf(tag, args);
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT leaf(String tag, String ... attrs) {
+		forward.append('<');
+		forward.append(tag);
+		addAttrs(attrs);
+		forward.append('>');
+		back.append("</");
+		back.append(tag);
+		back.append('>');
+		backStack.push(new Back(backSB.toString(), false, true));
+		backSB.setLength(0);
+		return (RT)this;
+	}
+
+	public RT incr(String tag, String ... args) {
+		return incr(null, tag, false, args);
+	}
+
+	public RT incr(String tag, boolean oneLine, String ... args) {
+		return incr(null, tag, oneLine, args);
+	}
+
+	public RT incr(Mark mark) {
+		return incr(mark,mark.comment, false, new String[0]);
+	}
+
+	public RT incr(Mark mark, String tag, String ... attrs) {
+		return incr(mark, tag, false, attrs);
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT incr(Mark mark, String tag, boolean oneLine, String ... attrs) {
+		forward.append('<');
+		forward.append(tag);
+		addAttrs(attrs);
+		forward.append('>');
+		
+		back.append("</");
+		back.append(tag);
+		back.append('>');
+	
+		if(pretty) {
+			if(mark!=null && mark.comment!=null) {
+				int fi = forward.getIndent()*IndentPrintWriter.INDENT;
+				for(int i = fi+backSB.length();i<=COMMENT_COLUMN;++i) {
+					back.append(' ');
+				}
+				back.append("<!-- end ");
+				back.append(mark.comment);
+				back.append(" -->");
+				
+				forward.toCol(COMMENT_COLUMN);
+				forward.append("<!-- begin ");
+				forward.append(mark.comment);
+				forward.append(" -->");
+			}
+			forward.inc();
+			if(!oneLine) {
+				forward.println();
+			}
+			back.println();
+		}
+		if(mark!=null)mark.spot = backStack.size();
+		backStack.push(new Back(backSB.toString(),true, false));
+		backSB.setLength(0);
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT tagOnly(String tag, String ... attrs) {
+		forward.append('<');
+		forward.append(tag);
+		addAttrs(attrs);
+		forward.append(" />");
+		if(pretty) {
+			forward.println();
+		}
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT text(String txt) {
+		forward.append(txt);
+		return (RT)this;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public RT xml(String txt) {
+		for(int i=0; i<txt.length();++i) {
+			char c = txt.charAt(i);
+			switch(c) {
+				case '<':
+					forward.append("&lt;");
+					break;
+				case '>':
+					forward.append("&gt;");
+					break;
+				case '&':
+					forward.append("&amp;");
+					break;
+				default:
+					forward.append(c);
+			}
+		}
+		return (RT)this;
+	}
+
+
+	@SuppressWarnings("unchecked")
+	public RT textCR(int tabs, String txt) {
+		for(int i=0;i<tabs;++i) {
+			forward.append("  ");
+		}
+		forward.append(txt);
+		if(pretty)forward.println();
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT value() {
+		Mark mark = new Mark();
+		mark.spot = backStack.size()-1;
+		end(mark);
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT value(String txt) {
+		forward.append(txt);
+		Mark mark = new Mark();
+		mark.spot = backStack.size()-1;
+		end(mark);
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT value(String txt, int levels) {
+		forward.append(txt);
+		Mark mark = new Mark();
+		mark.spot = backStack.size()-levels;
+		end(mark);
+		return (RT)this;
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT end(Mark mark) {
+		int size = backStack.size();
+		Back c;
+		boolean println = false;
+		for(int i=mark==null?0:mark.spot;i<size;++i) {
+			c = backStack.pop();
+			if(c.dec)forward.dec();
+			forward.append(c.str);
+			println = c.cr;
+		}
+		if(pretty && println) {
+			forward.println();
+		}
+		return (RT)this;
+	}
+
+	public RT end() {
+		Mark mark = new Mark();
+		mark.spot=backStack.size()-1;
+		if(mark.spot<0)mark.spot=0;
+		return end(mark);
+	}
+
+	public RT end(int i) {
+		Mark mark = new Mark();
+		mark.spot=backStack.size()-i;
+		if(mark.spot<0)mark.spot=0;
+		return end(mark);
+	}
+
+	public void endAll() {
+		end(new Mark());
+		forward.flush();
+	}
+
+	protected void addAttrs(String[] attrs) {
+		if(attrs!=null) {
+			for(String attr : attrs) {
+				if(attr!=null && attr.length()>0) {
+					forward.append(' ');
+					String[] split = attr.split("=",2);
+					switch(split.length) {
+						case 0:
+							break;
+						case 1:
+							forward.append(split[0]);
+//							forward.append("=\"\"");
+							break;
+						default:
+							forward.append(split[0]);
+							forward.append("=\"");
+							forward.append(split[1]);
+							forward.append('"');
+							break;
+					}
+				}
+			}
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public RT comment(String string) {
+		if(pretty) {
+			forward.print("<!--  ");
+			forward.print(string);
+			forward.println("  -->");
+		}
+		return (RT)this;
+	}
+
+	public void setIndent(int indent) {
+		forward.setIndent(indent);
+		forward.toIndent();
+	}
+
+	public int getIndent() {
+		return forward.getIndent();
+	}
+
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGenBuff.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGenBuff.java
new file mode 100644
index 0000000..95c4060
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/XGenBuff.java
@@ -0,0 +1,86 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen;
+
+import java.io.IOException;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.env.Env;
+import org.onap.aaf.misc.env.Trans;
+import org.onap.aaf.misc.env.util.StringBuilderWriter;
+import org.onap.aaf.misc.xgen.html.State;
+
+public class XGenBuff<G extends XGen<G>> {
+	private G xgen;
+	private StringBuilder sb;
+	// private String forward, backward;
+	
+	public XGenBuff(int flags, CacheGen<G> cg) {
+		sb = new StringBuilder();
+		xgen = cg.create(flags, new StringBuilderWriter(sb));
+	}
+
+	/**
+	 * Normal case of building up Cached HTML without transaction info
+	 * 
+	 * @param cache
+	 * @param code
+	 * @throws APIException
+	 * @throws IOException
+	 */
+	public void run(Cache<G> cache, Code<G> code) throws APIException, IOException {
+		code.code(cache, xgen);
+	}
+
+	/**
+	 * Special Case where code is dynamic, so give access to State and Trans info
+	 *  
+	 * @param state
+	 * @param trans
+	 * @param cache
+	 * @param code
+	 * @throws APIException
+	 * @throws IOException
+	 */
+	@SuppressWarnings({ "unchecked", "rawtypes" })
+	public void run(State<Env> state, Trans trans, Cache cache, DynamicCode code) throws APIException, IOException {
+			code.code(state, trans, cache, xgen);
+	}
+	
+	public int getIndent() {
+		return xgen.getIndent();
+	}
+
+	public void setIndent(int indent) {
+		xgen.setIndent(indent);
+	}
+
+	public Section<G> newSection() {
+		Section<G> s = new Section<G>();
+		s.indent = xgen.getIndent();
+		s.forward = sb.toString();
+		sb.setLength(0);
+		s.backward = sb.toString();
+		sb.setLength(0);
+		return s;
+	}
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML4Gen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML4Gen.java
new file mode 100644
index 0000000..dfab12c
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML4Gen.java
@@ -0,0 +1,143 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.io.Writer;
+
+import org.onap.aaf.misc.xgen.Mark;
+
+public class HTML4Gen extends HTMLGen {
+	private final static String DOCTYPE = 
+		/*
+		"<!DOCTYPE HTML PUBLIC " +
+		"\"-//W3C//DTD HTML 4.01 Transitional//EN\" " +
+		"\"http://www.w3.org/TR/html3/loose.dtd\">";
+		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" +
+		" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
+		*/
+		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" +
+		" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
+
+	public HTML4Gen(Writer w) {
+		super(w);
+	}
+
+	@Override
+	public HTMLGen html(String ... attrib) {
+		forward.println(DOCTYPE);
+		return incr("html","xmlns=http://www.w3.org/1999/xhtml","xml:lang=en","lang=en");
+		
+	}
+
+	@Override
+	public Mark head() {
+		Mark head = new Mark("head");
+		incr(head);
+		return head;
+	}
+
+	@Override
+	public Mark body(String ... attrs) {
+		Mark body = new Mark("body");
+		incr(body,"body",attrs);
+		return body;
+	}
+	
+	@Override
+	public HTML4Gen charset(String charset) {
+		forward.append("<meta http-equiv=\"Content-type\" content=\"text.hml; charset=");
+		forward.append(charset);
+		forward.append("\">");
+		prettyln(forward);
+		return this;
+	}
+
+	@Override
+	public Mark header(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="header";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+	@Override
+	public Mark footer(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="footer";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+	@Override
+	public Mark section(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="section";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+	@Override
+	public Mark article(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="attrib";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+	@Override
+	public Mark aside(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="aside";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+	@Override
+	public Mark nav(String ... attribs) {
+		String[] a = new String[attribs.length+1];
+		a[0]="nav";
+		System.arraycopy(attribs, 0, a, 1, attribs.length);
+		return divID(a);
+	}
+
+//	@Override
+//	protected void importCSS(Imports imports) {
+//		if(imports.css.size()==1) {
+//			cssInline(imports.css.get(0));
+//		} else {
+//			text("<style type=\"text/css\">");
+//			prettyln(forward);
+//			forward.inc();
+//			for(String str : imports.css) {
+//				forward.print("@import url(\"");
+//				forward.print(imports.themePath(null));
+//				forward.print(str);
+//				forward.print("\");");
+//				prettyln(forward);
+//			}
+//			forward.dec();
+//			forward.print("</style>");
+//			prettyln(forward);
+//		}
+//	}
+	
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java
new file mode 100644
index 0000000..d83004e
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTML5Gen.java
@@ -0,0 +1,155 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.io.Writer;
+
+import org.onap.aaf.misc.xgen.Mark;
+
+public class HTML5Gen extends HTMLGen {
+	public HTML5Gen(Writer w) {
+		super(w);
+	}
+
+	@Override
+	public HTMLGen html(String ... attrib) {
+		//forward.println("<!DOCTYPE html>");
+		incr("html",attrib);
+		return this;
+	}
+	
+	@Override
+	public Mark head() {
+		Mark head = new Mark("head");
+		incr(head).directive("meta","charset=utf-8");
+		return head;
+	}
+
+	@Override
+	public Mark body(String ... attrs) {
+		Mark body = new Mark("body");
+		incr(body,"body",attrs);
+		//chromeFrame();
+		return body;
+	}
+	
+	@Override
+	public HTML5Gen charset(String charset) {
+		forward.append("<meta charset=\"");
+		forward.append(charset);
+		forward.append("\">");
+		prettyln(forward);
+		return this;
+	}
+
+	@Override
+	public Mark header(String ... attribs) {
+		Mark mark = new Mark("header");
+		incr(mark, mark.comment, attribs);
+		return mark;
+	}
+
+	@Override
+	public Mark footer(String ... attribs) {
+		Mark mark = new Mark("footer");
+		incr(mark, mark.comment, attribs);
+		return mark;
+	}
+
+	@Override
+	public Mark section(String ... attribs) {
+		Mark mark = new Mark("section");
+		incr(mark, mark.comment,attribs);
+		return mark;
+	}
+
+	@Override
+	public Mark article(String ... attribs) {
+		Mark mark = new Mark("article");
+		incr(mark, mark.comment,attribs);
+		return mark;
+	}
+
+	@Override
+	public Mark aside(String ... attribs) {
+		Mark mark = new Mark("aside");
+		incr(mark, mark.comment,attribs);
+		return mark;
+	}
+
+	@Override
+	public Mark nav(String ... attribs) {
+		Mark mark = new Mark("nav");
+		incr(mark, mark.comment,attribs);
+		return mark;
+	}
+	
+
+//	@Override
+//	protected void importCSS(Imports imports) {
+//		if(imports.css.size() == 1) {
+//			cssInline(imports.css.get(0));
+//		} else {
+//			for(String str : imports.css) {
+//				forward.print("<link rel=\"stylesheet\" href=\"");
+//				forward.print(imports.themePath(null));
+//				forward.print(str);
+//				forward.println("\">");
+//			}
+//		}
+//	}
+//
+
+	/*
+	public void chromeFrame() {
+		this.textCR(0,"<!--[if IE]>");
+		Mark mark = new Mark();
+		this.leaf(mark, "script","type=text/javascript","src=http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js")
+			.end(mark);
+		this.incr(mark, "style")
+			.textCR(0,".chromeFrameInstallDefaultStyle {")
+			.textCR(1,"width: 100%; /* default is 800px * /")
+			.textCR(1,"border: 5px solid blue;")
+			.textCR(0,"}")
+			.end(mark);
+
+		this.incr(mark,"div","id=prompt"); // auto comment would break IE specific Script
+		// "if IE without GCF, prompt goes here"
+		this.text("Please load this plugin to run ClientSide Websockets")
+			.end(mark);
+
+		this.incr(mark, "script")
+			.textCR(0, "// The conditional ensures that this code will only execute in IE,")
+				.textCR(0, "// Therefore we can use the IE-specific attachEvent without worry")
+				.textCR(0, "window.attachEvent('onload', function() {")
+				.textCR(1,"CFInstall.check({")
+					.textCR(2,"mode: 'inline', // the default")
+					.textCR(2,"node: 'prompt'")
+				.textCR(1, "});")
+			.textCR(0, "});")
+			.end(mark);
+			
+		this.textCR(0,"<![endif]-->");
+	}
+	*/
+
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLCacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLCacheGen.java
new file mode 100644
index 0000000..8fba155
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLCacheGen.java
@@ -0,0 +1,59 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.xgen.CacheGen;
+import org.onap.aaf.misc.xgen.Code;
+
+public class HTMLCacheGen extends CacheGen<HTMLGen> {
+	protected int flags;
+
+	public HTMLCacheGen(int flags, Code<HTMLGen> code) throws APIException,IOException {
+		super(flags, code);
+		this.flags = flags;
+	}
+
+	@Override
+	public HTMLGen create(int htmlStyle, Writer w) {
+		HTMLGen hg;
+		switch(htmlStyle&(CacheGen.HTML4|CacheGen.HTML5)) {
+			case CacheGen.HTML4:
+				hg = new HTML4Gen(w);
+				break;
+			case CacheGen.HTML5:
+			default:
+				hg = new HTML5Gen(w);
+				break;
+
+		}
+		hg.pretty = (htmlStyle&CacheGen.PRETTY)>0;
+		return hg;
+	}
+
+	protected HTMLGen clone(Writer w) {
+		return create(flags,w);
+	}
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLGen.java
new file mode 100644
index 0000000..92a89d7
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/HTMLGen.java
@@ -0,0 +1,240 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.io.Writer;
+
+import org.onap.aaf.misc.xgen.Mark;
+import org.onap.aaf.misc.xgen.XGen;
+
+public abstract class HTMLGen extends XGen<HTMLGen> {
+	public static final String A = "a";
+	public static final String P = "p";
+	public static final String LI = "li";
+	public static final String OL = "ol";
+	public static final String UL = "ul";
+	
+	
+	public static final String TABLE = "table";
+	public static final String THEAD = "thead";
+	public static final String TBODY = "tbody";
+	public static final String TR = "tr";
+	public static final String TH = "th";
+	public static final String TD = "td";
+	
+	public static final String TITLE = "title";
+	public static final String H1 = "h1";
+	public static final String H2 = "h2";
+	public static final String H3 = "h3";
+	public static final String H4 = "h4";
+	public static final String H5 = "h5";
+	
+	
+	
+	// --------------------------- HTML Version Specific -----------------------
+	public abstract HTMLGen html(String ... attributes);
+	public abstract HTMLGen charset(String charset);
+	public abstract Mark head();
+	public abstract Mark body(String ... attribs);
+
+	
+	// HTML 5 has simplified sectioning
+	public abstract Mark header(String ... attribs);
+	public abstract Mark footer(String ... attribs);
+	public abstract Mark section(String ... attribs);
+	public abstract Mark article(String ... attribs);
+	public abstract Mark aside(String ... attribs);
+	public abstract Mark nav(String ... attribs);
+
+	// --------------------------- HTML Version Specific -----------------------
+
+	public HTMLGen imports(Imports imports) {
+		//this.imports=imports;
+		for(String str : imports.css) {
+			forward.print("<link rel=\"stylesheet\" href=\"");
+			forward.print(imports.themePath(null));
+			forward.print(str);
+			forward.println("\">");
+		}
+
+		for(String str : imports.js) {
+			forward.print("<script type=\"text/javascript\" src=\"");
+			forward.print(imports.themePath(null));
+			forward.print(str);
+			forward.println("\"></script>");
+		}
+		return this;
+	}
+	
+	public HTMLGen jsVars(String ... attrs) {
+		forward.println("<script type=text/javascript>");
+		if(attrs!=null) {
+			for(int i=0; i<attrs.length;++i) {
+				forward.append(' ');
+				String[] split = attrs[i].split("=",2);
+				switch(split.length) {
+					case 2:
+						forward.print("  var ");
+						forward.append(split[0]);
+						forward.append("='");
+						forward.append(split[1]);
+						forward.println("';");
+						break;
+				}
+			}
+		}
+		forward.println("</script>");
+		return this;
+	}
+
+	public HTMLGen(Writer w) {
+		super(w);
+	}
+
+	/**
+	 * Use "directive" to handle non-ended HTML tags like <meta ... >  and <link ...>
+	 * @param tag
+	 * @param attrs
+	 * @return
+	 */
+	public HTMLGen directive(String tag, String ... attrs) {
+		forward.append('<');
+		forward.append(tag);
+		addAttrs(attrs);
+		forward.append('>');
+		if(pretty) {
+			forward.println();
+		}
+		return this;
+	}
+
+	public Mark divID(String ... attrs) {
+		Mark div;
+		if(attrs.length>0) {
+			div = new Mark(attrs[0]);
+			attrs[0]="id="+attrs[0];
+		} else {
+			div = new Mark();
+		}
+		incr(div, "div", attrs);
+		return div;
+	}
+
+	public HTMLGen img(String ... attrs) {
+		return tagOnly("img", attrs);
+	}
+	
+	/**
+	 * Input Cheesecake... creates a Label and Field in the form of Table Rows.
+	 * Make sure you create a table first, ie.  incr(HTMLGen.TABLE);
+	 * 
+	 * Setting Required to "true" will add required Attribute to both Label and Field.  In HTML5, "required" in the input will
+	 * validate there is data in the fields before submitting.  "required" does nothing for label, but allows for
+	 * easy CSS coding... "label[required] { ... }", so that colors can be changed
+	 * 
+	 * @param id
+	 * @param label
+	 * @param required
+	 * @param attrs
+	 * @return
+	 */
+	public HTMLGen input(String id, String label, boolean required, String ... attrs) {
+		Mark mtr = new Mark(TR);
+		Mark mtd = new Mark(TD);
+		incr(mtr);
+		incr(mtd);
+		incr("label",true, "for="+id,required?"required":null).text(label).end();
+		end(mtd);
+		String nattrs[] = new String[attrs.length+(required?3:2)];
+		nattrs[0]="id="+id;
+		nattrs[1]="name="+id;
+		System.arraycopy(attrs, 0, nattrs, 2, attrs.length);
+		if(required) {
+			nattrs[nattrs.length-1]="required";
+		}
+		incr(mtd);
+		tagOnly("input",nattrs);
+		end(mtr);
+		return this;
+	}
+	
+	//  Common tags that do not have standard endings.  These are here to help people who don't know to pick directive  
+	public HTMLGen br() {
+		forward.append("<br>");
+		if(pretty) {
+			forward.println();
+		}
+		return this;
+	}
+
+	public HTMLGen p(String ... text) {
+		forward.append("<p>");
+		for(String s : text) {
+			forward.append(s);
+		}
+		if(pretty) {
+			forward.println();
+		}
+		return this;
+	}
+
+	public HTMLGen hr() {
+		forward.append("<hr>");
+		if(pretty) {
+			forward.println();
+		}
+		return this;
+	}
+
+	public JSGen js(Mark mark) {
+		return new JSGen(mark, this);
+	}
+
+	public JSGen js() {
+		return js(null);
+	}
+//
+//	protected void cssInline(String filename) {
+//		File file = new File(imports.webDir,filename);
+//		try {
+//			String line;
+//			BufferedReader br = new BufferedReader(new FileReader(file));
+//			try {
+//				forward.print("<style>");
+//				prettyln(forward);
+//				while((line=br.readLine())!=null) {
+//					forward.print((pretty?line:line.trim()));
+//					prettyln(forward);
+//				}			
+//			}finally {
+//				forward.print("</style>");
+//				prettyln(forward);
+//				br.close();
+//			}
+//		} catch (IOException e) {
+//			e.printStackTrace();
+//			// Can't read, suffice to import normally?
+//			// for now, just skip
+//		}
+//	}
+	
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Imports.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Imports.java
new file mode 100644
index 0000000..90e8260
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Imports.java
@@ -0,0 +1,98 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Imports implements Thematic{
+	List<String> css,js;
+	public final int backdots;
+//	public final File webDir;
+	private String theme;
+	
+	public Imports(int backdots) {
+//		this.webDir = webDir;
+		
+		css = new ArrayList<String>();
+		js = new ArrayList<String>();
+		this.backdots = backdots;
+		theme = "";
+	}
+	
+	public Imports css(String str) {
+		css.add(str);
+		return this;
+	}
+	
+	public Imports js(String str) {
+		js.add(str);
+		return this;
+	}
+
+	public Imports theme(String str) {
+		theme = str==null?"":str;
+		return this;
+	}
+
+	/**
+	 * Pass in a possible Theme.  If it is "" or null, it will resolve to default Theme set in Imports
+	 * 
+	 * @param theTheme
+	 * @return
+	 */
+	@Override
+	public String themePath(String theTheme) {
+		StringBuilder src = dots(new StringBuilder());
+		if(theTheme==null||theTheme.length()==0) {
+			src.append(theme);
+			if(theme.length()>0)src.append('/');
+		} else {
+			src.append(theTheme);
+			src.append('/');
+		}
+
+		return src.toString();
+	}
+	
+	/**
+	 * Pass in a possible Theme.  If it is "" or null, it will resolve to default Theme set in Imports
+	 * 
+	 * @param theTheme
+	 * @return
+	 */
+	@Override
+	public String themeResolve(String theTheme) {
+		return (theTheme==null||theTheme.length()==0)
+			?theme
+			:theTheme;
+	}
+
+	public StringBuilder dots(StringBuilder src) {
+		for(int i=0;i<backdots;++i) {
+			src.append("../");
+		}
+		return src;
+	}
+	
+};
+
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/JSGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/JSGen.java
new file mode 100644
index 0000000..be19a27
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/JSGen.java
@@ -0,0 +1,204 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.onap.aaf.misc.env.util.IndentPrintWriter;
+import org.onap.aaf.misc.xgen.Back;
+import org.onap.aaf.misc.xgen.Mark;
+
+
+public class JSGen {
+	private HTMLGen htmlGen;
+	private IndentPrintWriter ipw;
+	private Mark mark;
+
+	public JSGen(Mark mark, HTMLGen hg) {
+		this.mark = mark==null?new Mark():mark;
+		hg.incr(this.mark, "script", "language=javascript", "type=text/javascript");
+		htmlGen = hg;
+		ipw = hg.getWriter();
+	}
+
+	public JSGen inline(String filename, int tabstop) throws IOException {
+		BufferedReader br = new BufferedReader(new FileReader(filename));
+		int indent = htmlGen.getIndent();
+		try {
+			boolean pretty = htmlGen.pretty;
+			String line, el;
+			int l, end;
+			while((line=br.readLine())!=null) {
+				if(pretty) {
+					String[] elements = line.split("\t");
+					
+					for(int i=0; i<elements.length;++i) {
+						el = elements[i];
+						l = el.length();
+						if(l==0) {// was a Tab
+							ipw.print("  ");
+						} else {
+							el = el.trim();
+							l = l-el.length();
+							end = l/tabstop;
+							for(int j=0;j<end;++j) {
+								ipw.print("  ");
+							}
+							end = l%tabstop;
+							for(int j=0;j<end;++j) {
+								ipw.print(' ');
+							}
+							if(i>0) ipw.print(' ');
+								ipw.print(el);
+							}
+					}
+					ipw.println();
+				} else {
+					ipw.print(line.trim());
+				}
+			}
+		} finally {
+			htmlGen.setIndent(indent);
+			try {
+				br.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		return this;
+	}
+	
+	public JSGen pst(String ... lines) {
+		return pst(null, lines);
+	}
+	
+	public JSGen pst(Mark jm, String ... lines) {
+		if(lines.length>0) ipw.append(lines[0]);
+		ipw.append('(');
+		for(int i=1;i<lines.length;++i) {
+			ipw.print(lines[i]);
+			ipw.print(", ");
+		}
+		Back back;
+
+		if(htmlGen.pretty) {
+			back = new Back(");\n",false,false);
+		} else {
+			back = new Back(");",false,false);
+		}
+		int spot = htmlGen.pushBack(back);
+		if(jm!=null)jm.spot(spot);
+		return this;
+	}
+	
+	public JSGen li(String ... lines) {
+		int current = ipw.getIndent();
+		for(int i=0;i<lines.length;++i) {
+			if(i==1)ipw.inc();
+			if(i>0)ipw.println();
+			ipw.print(lines[i]);
+		}
+		ipw.setIndent(current);
+		ipw.append(';');
+		if(htmlGen.pretty)ipw.println();
+		return this;
+	}
+	
+	public JSGen text(String text) {
+		ipw.append(text);
+		if(htmlGen.pretty)ipw.println();
+		return this;
+	}
+
+	public JSGen function(String name, String ... params) {
+		return function(null, name, params);
+	}
+	
+	public JSGen jqfunc(Mark mark, String name, String ... params) {
+		pst(mark,"$").function(name, params);
+		return this;
+	}
+	
+	public JSGen function(Mark jm, String name, String ... params) {
+		ipw.print("function ");
+		ipw.print(name);
+		ipw.print('(');
+		for(int i=0;i<params.length;++i) {
+			if(i!=0)ipw.print(", ");
+			ipw.print(params[i]);
+		}
+		ipw.print(") {");
+		if(htmlGen.pretty) {
+			ipw.println();
+			ipw.inc();
+		}
+		int spot = htmlGen.pushBack(new Back("}",true,true));
+		if(jm!=null)jm.spot(spot); 
+		return this;
+	}
+	
+	public JSGen cb(String ... lines) {
+		return cb(null,lines);
+	}
+
+	public JSGen cb(Mark jm, String ... lines) {
+		int current = ipw.getIndent();
+		for(int i=0;i<lines.length;++i) {
+			if(i==1)ipw.inc();
+			if(i>0)ipw.println();
+			ipw.print(lines[i]);
+		}
+		ipw.setIndent(current);
+		ipw.print('{');
+		if(htmlGen.pretty) {
+			ipw.println();
+			ipw.inc();
+		}
+		int spot = htmlGen.pushBack(new Back("}",true,true));
+		if(jm!=null)jm.spot(spot); 
+		return this;
+
+	}
+
+	
+	public JSGen comment(String ... lines) {
+		if(htmlGen.pretty) {
+			for(int i=0;i<lines.length;++i) {
+				ipw.print("// ");
+				ipw.println(lines[i]);
+			}
+		}
+		return this;
+	}
+	
+	public JSGen end(Mark mark) {
+		htmlGen.end(mark);
+		return this;
+	}
+	
+	public HTMLGen done() {
+		return htmlGen.end(mark);
+	}
+	
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/State.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/State.java
new file mode 100644
index 0000000..93f6da1
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/State.java
@@ -0,0 +1,27 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+import org.onap.aaf.misc.env.Env;
+
+public interface State<ENV extends Env> {
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Thematic.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Thematic.java
new file mode 100644
index 0000000..98835dc
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/html/Thematic.java
@@ -0,0 +1,27 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.html;
+
+public interface Thematic {
+	String themePath(String theTheme);
+	String themeResolve(String theTheme);
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLCacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLCacheGen.java
new file mode 100644
index 0000000..16ce436
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLCacheGen.java
@@ -0,0 +1,45 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.xml;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.onap.aaf.misc.env.APIException;
+import org.onap.aaf.misc.xgen.CacheGen;
+import org.onap.aaf.misc.xgen.Code;
+
+public class XMLCacheGen extends CacheGen<XMLGen> {
+
+	public XMLCacheGen(int flags, Code<XMLGen> code) throws APIException,
+			IOException {
+		super(flags, code);
+	}
+
+	@Override
+	public XMLGen create(int style, Writer w) {
+		XMLGen xg = new XMLGen(w);
+		xg.pretty = (style & PRETTY)==PRETTY;
+		return xg;
+	}
+
+}
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLGen.java
new file mode 100644
index 0000000..1894567
--- /dev/null
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/xml/XMLGen.java
@@ -0,0 +1,44 @@
+/**
+ * ============LICENSE_START====================================================
+ * org.onap.aaf
+ * ===========================================================================
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ * ===========================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END====================================================
+ *
+ */
+
+package org.onap.aaf.misc.xgen.xml;
+
+import java.io.Writer;
+
+import org.onap.aaf.misc.xgen.XGen;;
+
+public class XMLGen extends XGen<XMLGen> {
+	private final String XML_TAG; 
+	
+	public XMLGen(Writer w) {
+		this(w,"UTF-8");
+	}
+	
+	public XMLGen(Writer w, String encoding) {
+		super(w);
+		XML_TAG="<?xml version=\"1.0\" encoding=\"" + encoding + "\" standalone=\"yes\"?>"; 
+	}
+
+	public XMLGen xml() {
+		forward.println(XML_TAG);
+		return this;
+	}
+}
