package org.mustangproject.ZUGFeRD;

public class CustomXMLProvider implements IXMLProvider {

	protected byte[] zugferdData;
	
	@Override
	public byte[] getXML() {
		return zugferdData;
	}

	public void setXML(byte[] newData) {
		zugferdData=newData;
	}

	@Override
	public void generateXML(IZUGFeRDExportableTransaction trans) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setTest() {
		// TODO Auto-generated method stub
		
	}

}

@@ -222,16 +222,208 @@
 Data) %7B%0A
+%09%09String zf=new String(newData);%0A%09%09if (!zf.contains(%22%3Crsm:CrossIndustry%22)) %7B%0A%09%09%09throw new RuntimeException(%22ZUGFeRD XML does not contain %3Crsm:CrossIndustry and can thus not be valid%22);%0A%09%09%7D%0A%09%09%0A
 %09%09zugfer

Make sure custom XML provided by some anonymous developer is at least halfway valid ;-)