Buggy code:
public class CIQIdentity { public CIQIdentity ( ) { } @ SuppressWarnings ( "serial" ) public static void main ( String [ ] args ) { try { XMLGregorianCalendar now = DatatypeFactory . newInstance ( ) . newXMLGregorianCalendar ( new GregorianCalendar ( TimeZone . getTimeZone ( "UTC" ) ) ) ; ContactNumbers contactNumbers = new ContactNumbers ( ) . withContactNumbers ( new ContactNumbers . ContactNumber ( ) . withContactNumberElements ( new ContactNumbers . ContactNumber . ContactNumberElement ( ) . withValue ( "555-555-5555" ) , new ContactNumbers . ContactNumber . ContactNumberElement ( ) . withValue ( "555-555-5556" ) ) ) ; ElectronicAddressIdentifiers electronicAddressIdentifiers = new ElectronicAddressIdentifiers ( ) . withElectronicAddressIdentifiers ( new ElectronicAddressIdentifiers . ElectronicAddressIdentifier ( ) . withValue ( "jsmith@example.com" ) ) ; FreeTextLines freeTextLines = new FreeTextLines ( ) . withFreeTextLines ( new FreeTextLines . FreeTextLine ( ) . withValue ( "Demonstrating<seq2seq4repair_space>Free<seq2seq4repair_space>Text!" ) ) ; PartyNameType partyName = new PartyNameType ( ) . withNameLines ( new NameLine ( ) . withValue ( "Foo" ) , new NameLine ( ) . withValue ( "Bar" ) ) . withPersonNames ( new PersonName ( ) . withNameElements ( new NameElement ( ) . withValue ( "John<seq2seq4repair_space>Smith" ) ) , new PersonName ( ) . withNameElements ( new NameElement ( ) . withValue ( "Jill<seq2seq4repair_space>Smith" ) ) ) . withOrganisationNames ( new OrganisationName ( ) . withNameElements ( new oasis . names . tc . ciq . xnl . _3 . OrganisationNameType . NameElement ( ) . withValue ( "Foo<seq2seq4repair_space>Inc." ) ) , new OrganisationName ( ) . withNameElements ( new oasis . names . tc . ciq . xnl . _3 . OrganisationNameType . NameElement ( ) . withValue ( "Bar<seq2seq4repair_space>Corp." ) ) ) ; STIXCIQIdentity30Type specification = new STIXCIQIdentity30Type ( ) . withContactNumbers ( contactNumbers ) . withElectronicAddressIdentifiers ( electronicAddressIdentifiers ) . withFreeTextLines ( freeTextLines ) . withPartyName ( partyName ) ; CIQIdentity30InstanceType identity = new CIQIdentity30InstanceType ( ) . withSpecification ( specification ) ; InformationSourceType producer = new InformationSourceType ( ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "An<seq2seq4repair_space>indicator<seq2seq4repair_space>containing<seq2seq4repair_space>a<seq2seq4repair_space>File<seq2seq4repair_space>observable<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>associated<seq2seq4repair_space>hash" ) ) . withTime ( new TimeType ( ) . withProducedTime ( new DateTimeWithPrecisionType ( now , null ) ) ) . withIdentity ( identity ) ; FileObjectType fileObject = new FileObjectType ( ) . withHashes ( new HashListType ( new ArrayList < HashType > ( ) { } ) ) ; ObjectType obj = new ObjectType ( ) . withProperties ( fileObject ) . withId ( new QName ( "http:////example.com//" , ( "file-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; Observable observable = new Observable ( ) . withId ( new QName ( "http:////example.com//" , ( "observable-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; observable . setObject ( obj ) ; final Indicator indicator = new Indicator ( ) . withId ( new QName ( "http:////example.com//" , ( "indicator-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) . withTimestamp ( now ) . withTitle ( "File<seq2seq4repair_space>Hash<seq2seq4repair_space>Example" ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "An<seq2seq4repair_space>indicator<seq2seq4repair_space>containing<seq2seq4repair_space>a<seq2seq4repair_space>File<seq2seq4repair_space>observable<seq2seq4repair_space>with<seq2seq4repair_space>an<seq2seq4repair_space>associated<seq2seq4repair_space>hash" ) ) . withProducer ( producer ) . withObservable ( observable ) ; IndicatorsType indicators = new IndicatorsType ( new ArrayList < IndicatorBaseType > ( ) { } ) ; STIXHeaderType header = new STIXHeaderType ( ) . withDescriptions ( new StructuredTextType ( ) . withValue ( "Example" ) ) ; <START_BUG> STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( header ) . withIndicators ( indicators ) . withVersion ( "1.2.0" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ; <END_BUG> System . out . println ( stixPackage . toXMLString ( true ) ) ; System . out . println ( StringUtils . repeat ( "-" , 120 ) ) ; System . out . println ( ( "Validates:<seq2seq4repair_space>" + ( stixPackage . validate ( ) ) ) ) ; System . out . println ( StringUtils . repeat ( "-" , 120 ) ) ; System . out . println ( STIXPackage . fromXMLString ( stixPackage . toXMLString ( ) ) . toXMLString ( true ) ) ; } catch ( DatatypeConfigurationException e ) { throw new RuntimeException ( e ) ; } } }

Fix:
STIXPackage stixPackage = new STIXPackage ( ) . withSTIXHeader ( header ) . withIndicators ( indicators ) . withVersion ( "1.2" ) . withTimestamp ( now ) . withId ( new QName ( "http:////example.com//" , ( "package-" + ( UUID . randomUUID ( ) . toString ( ) ) ) , "example" ) ) ;