001package org.hl7.fhir.r5.formats;
002
003// generated
004
005/*
006  Copyright (c) 2011+, HL7, Inc.
007  All rights reserved.
008  
009  Redistribution and use in source and binary forms, with or without modification, \
010  are permitted provided that the following conditions are met:
011  
012   * Redistributions of source code must retain the above copyright notice, this \
013     list of conditions and the following disclaimer.
014   * Redistributions in binary form must reproduce the above copyright notice, \
015     this list of conditions and the following disclaimer in the documentation \
016     and/or other materials provided with the distribution.
017   * Neither the name of HL7 nor the names of its contributors may be used to 
018     endorse or promote products derived from this software without specific 
019     prior written permission.
020  
021  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND \
022  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \
023  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \
024  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \
025  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT \
026  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR \
027  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \
028  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \
029  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \
030  POSSIBILITY OF SUCH DAMAGE.
031  */
032
033// Generated on Tue, Dec 21, 2021 05:44+1100 for FHIR v5.0.0-snapshot1
034
035
036
037import org.hl7.fhir.r5.model.*;
038import org.hl7.fhir.r5.model.Enumerations.FHIRVersion;
039import org.xmlpull.v1.*;
040import org.hl7.fhir.utilities.Utilities;
041import org.hl7.fhir.exceptions.FHIRFormatError;
042import org.hl7.fhir.exceptions.FHIRException;
043import java.io.IOException;
044
045public class XmlParser extends XmlParserBase {
046
047  public XmlParser() {
048    super();
049  }
050
051  public XmlParser(boolean allowUnknownContent) {
052    super();
053    setAllowUnknownContent(allowUnknownContent);
054  }
055
056  protected boolean parseBaseContent(int eventType, XmlPullParser xpp, Base res) throws XmlPullParserException, IOException, FHIRFormatError {
057    return false;
058  }
059
060  @SuppressWarnings("unchecked")
061  protected <E extends Enum<E>> Enumeration<E> parseEnumeration(XmlPullParser xpp, E item, EnumFactory e) throws XmlPullParserException, IOException, FHIRFormatError {
062    Enumeration<E> res = new Enumeration<E>(e);
063    parseElementAttributes(xpp, res);
064    res.setValue((E) e.fromCode(xpp.getAttributeValue(null, "value")));
065    next(xpp);
066    int eventType = nextNoWhitespace(xpp);
067    while (eventType != XmlPullParser.END_TAG) {
068      if (!parseElementContent(eventType, xpp, res))
069        unknownContent(xpp);
070      eventType = nextNoWhitespace(xpp);
071    }
072    next(xpp);
073    parseElementClose(res);
074    return res;
075  }
076
077  protected DateType parseDate(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
078    DateType res = new DateType(xpp.getAttributeValue(null, "value"));
079    parseElementAttributes(xpp, res);
080    next(xpp);
081    int eventType = nextNoWhitespace(xpp);
082    while (eventType != XmlPullParser.END_TAG) {
083      if (!parseElementContent(eventType, xpp, res))
084        unknownContent(xpp);
085      eventType = nextNoWhitespace(xpp);
086    }
087    next(xpp);
088    parseElementClose(res);
089    return res;
090  }
091
092  protected DateTimeType parseDateTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
093    DateTimeType res = new DateTimeType(xpp.getAttributeValue(null, "value"));
094    parseElementAttributes(xpp, res);
095    next(xpp);
096    int eventType = nextNoWhitespace(xpp);
097    while (eventType != XmlPullParser.END_TAG) {
098      if (!parseElementContent(eventType, xpp, res))
099        unknownContent(xpp);
100      eventType = nextNoWhitespace(xpp);
101    }
102    next(xpp);
103    parseElementClose(res);
104    return res;
105  }
106
107  protected CodeType parseCode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
108    CodeType res = new CodeType(xpp.getAttributeValue(null, "value"));
109    parseElementAttributes(xpp, res);
110    next(xpp);
111    int eventType = nextNoWhitespace(xpp);
112    while (eventType != XmlPullParser.END_TAG) {
113      if (!parseElementContent(eventType, xpp, res))
114        unknownContent(xpp);
115      eventType = nextNoWhitespace(xpp);
116    }
117    next(xpp);
118    parseElementClose(res);
119    return res;
120  }
121
122  protected StringType parseString(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
123    StringType res = new StringType(xpp.getAttributeValue(null, "value"));
124    parseElementAttributes(xpp, res);
125    next(xpp);
126    int eventType = nextNoWhitespace(xpp);
127    while (eventType != XmlPullParser.END_TAG) {
128      if (!parseElementContent(eventType, xpp, res))
129        unknownContent(xpp);
130      eventType = nextNoWhitespace(xpp);
131    }
132    next(xpp);
133    parseElementClose(res);
134    return res;
135  }
136
137  protected IntegerType parseInteger(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
138    IntegerType res = new IntegerType(xpp.getAttributeValue(null, "value"));
139    parseElementAttributes(xpp, res);
140    next(xpp);
141    int eventType = nextNoWhitespace(xpp);
142    while (eventType != XmlPullParser.END_TAG) {
143      if (!parseElementContent(eventType, xpp, res))
144        unknownContent(xpp);
145      eventType = nextNoWhitespace(xpp);
146    }
147    next(xpp);
148    parseElementClose(res);
149    return res;
150  }
151
152  protected Integer64Type parseInteger64(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
153    Integer64Type res = new Integer64Type(xpp.getAttributeValue(null, "value"));
154    parseElementAttributes(xpp, res);
155    next(xpp);
156    int eventType = nextNoWhitespace(xpp);
157    while (eventType != XmlPullParser.END_TAG) {
158      if (!parseElementContent(eventType, xpp, res))
159        unknownContent(xpp);
160      eventType = nextNoWhitespace(xpp);
161    }
162    next(xpp);
163    parseElementClose(res);
164    return res;
165  }
166
167  protected OidType parseOid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
168    OidType res = new OidType(xpp.getAttributeValue(null, "value"));
169    parseElementAttributes(xpp, res);
170    next(xpp);
171    int eventType = nextNoWhitespace(xpp);
172    while (eventType != XmlPullParser.END_TAG) {
173      if (!parseElementContent(eventType, xpp, res))
174        unknownContent(xpp);
175      eventType = nextNoWhitespace(xpp);
176    }
177    next(xpp);
178    parseElementClose(res);
179    return res;
180  }
181
182  protected CanonicalType parseCanonical(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
183    CanonicalType res = new CanonicalType(xpp.getAttributeValue(null, "value"));
184    parseElementAttributes(xpp, res);
185    next(xpp);
186    int eventType = nextNoWhitespace(xpp);
187    while (eventType != XmlPullParser.END_TAG) {
188      if (!parseElementContent(eventType, xpp, res))
189        unknownContent(xpp);
190      eventType = nextNoWhitespace(xpp);
191    }
192    next(xpp);
193    parseElementClose(res);
194    return res;
195  }
196
197  protected UriType parseUri(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
198    UriType res = new UriType(xpp.getAttributeValue(null, "value"));
199    parseElementAttributes(xpp, res);
200    next(xpp);
201    int eventType = nextNoWhitespace(xpp);
202    while (eventType != XmlPullParser.END_TAG) {
203      if (!parseElementContent(eventType, xpp, res))
204        unknownContent(xpp);
205      eventType = nextNoWhitespace(xpp);
206    }
207    next(xpp);
208    parseElementClose(res);
209    return res;
210  }
211
212  protected UuidType parseUuid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
213    UuidType res = new UuidType(xpp.getAttributeValue(null, "value"));
214    parseElementAttributes(xpp, res);
215    next(xpp);
216    int eventType = nextNoWhitespace(xpp);
217    while (eventType != XmlPullParser.END_TAG) {
218      if (!parseElementContent(eventType, xpp, res))
219        unknownContent(xpp);
220      eventType = nextNoWhitespace(xpp);
221    }
222    next(xpp);
223    parseElementClose(res);
224    return res;
225  }
226
227  protected UrlType parseUrl(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
228    UrlType res = new UrlType(xpp.getAttributeValue(null, "value"));
229    parseElementAttributes(xpp, res);
230    next(xpp);
231    int eventType = nextNoWhitespace(xpp);
232    while (eventType != XmlPullParser.END_TAG) {
233      if (!parseElementContent(eventType, xpp, res))
234        unknownContent(xpp);
235      eventType = nextNoWhitespace(xpp);
236    }
237    next(xpp);
238    parseElementClose(res);
239    return res;
240  }
241
242  protected InstantType parseInstant(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
243    InstantType res = new InstantType(xpp.getAttributeValue(null, "value"));
244    parseElementAttributes(xpp, res);
245    next(xpp);
246    int eventType = nextNoWhitespace(xpp);
247    while (eventType != XmlPullParser.END_TAG) {
248      if (!parseElementContent(eventType, xpp, res))
249        unknownContent(xpp);
250      eventType = nextNoWhitespace(xpp);
251    }
252    next(xpp);
253    parseElementClose(res);
254    return res;
255  }
256
257  protected BooleanType parseBoolean(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
258    BooleanType res = new BooleanType(xpp.getAttributeValue(null, "value"));
259    parseElementAttributes(xpp, res);
260    next(xpp);
261    int eventType = nextNoWhitespace(xpp);
262    while (eventType != XmlPullParser.END_TAG) {
263      if (!parseElementContent(eventType, xpp, res))
264        unknownContent(xpp);
265      eventType = nextNoWhitespace(xpp);
266    }
267    next(xpp);
268    parseElementClose(res);
269    return res;
270  }
271
272  protected Base64BinaryType parseBase64Binary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
273    Base64BinaryType res = new Base64BinaryType(xpp.getAttributeValue(null, "value"));
274    parseElementAttributes(xpp, res);
275    next(xpp);
276    int eventType = nextNoWhitespace(xpp);
277    while (eventType != XmlPullParser.END_TAG) {
278      if (!parseElementContent(eventType, xpp, res))
279        unknownContent(xpp);
280      eventType = nextNoWhitespace(xpp);
281    }
282    next(xpp);
283    parseElementClose(res);
284    return res;
285  }
286
287  protected UnsignedIntType parseUnsignedInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
288    UnsignedIntType res = new UnsignedIntType(xpp.getAttributeValue(null, "value"));
289    parseElementAttributes(xpp, res);
290    next(xpp);
291    int eventType = nextNoWhitespace(xpp);
292    while (eventType != XmlPullParser.END_TAG) {
293      if (!parseElementContent(eventType, xpp, res))
294        unknownContent(xpp);
295      eventType = nextNoWhitespace(xpp);
296    }
297    next(xpp);
298    parseElementClose(res);
299    return res;
300  }
301
302  protected MarkdownType parseMarkdown(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
303    MarkdownType res = new MarkdownType(xpp.getAttributeValue(null, "value"));
304    parseElementAttributes(xpp, res);
305    next(xpp);
306    int eventType = nextNoWhitespace(xpp);
307    while (eventType != XmlPullParser.END_TAG) {
308      if (!parseElementContent(eventType, xpp, res))
309        unknownContent(xpp);
310      eventType = nextNoWhitespace(xpp);
311    }
312    next(xpp);
313    parseElementClose(res);
314    return res;
315  }
316
317  protected TimeType parseTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
318    TimeType res = new TimeType(xpp.getAttributeValue(null, "value"));
319    parseElementAttributes(xpp, res);
320    next(xpp);
321    int eventType = nextNoWhitespace(xpp);
322    while (eventType != XmlPullParser.END_TAG) {
323      if (!parseElementContent(eventType, xpp, res))
324        unknownContent(xpp);
325      eventType = nextNoWhitespace(xpp);
326    }
327    next(xpp);
328    parseElementClose(res);
329    return res;
330  }
331
332  protected IdType parseId(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
333    IdType res = new IdType(xpp.getAttributeValue(null, "value"));
334    parseElementAttributes(xpp, res);
335    next(xpp);
336    int eventType = nextNoWhitespace(xpp);
337    while (eventType != XmlPullParser.END_TAG) {
338      if (!parseElementContent(eventType, xpp, res))
339        unknownContent(xpp);
340      eventType = nextNoWhitespace(xpp);
341    }
342    next(xpp);
343    parseElementClose(res);
344    return res;
345  }
346
347  protected PositiveIntType parsePositiveInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
348    PositiveIntType res = new PositiveIntType(xpp.getAttributeValue(null, "value"));
349    parseElementAttributes(xpp, res);
350    next(xpp);
351    int eventType = nextNoWhitespace(xpp);
352    while (eventType != XmlPullParser.END_TAG) {
353      if (!parseElementContent(eventType, xpp, res))
354        unknownContent(xpp);
355      eventType = nextNoWhitespace(xpp);
356    }
357    next(xpp);
358    parseElementClose(res);
359    return res;
360  }
361
362  protected DecimalType parseDecimal(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
363    DecimalType res = new DecimalType(xpp.getAttributeValue(null, "value"));
364    parseElementAttributes(xpp, res);
365    next(xpp);
366    int eventType = nextNoWhitespace(xpp);
367    while (eventType != XmlPullParser.END_TAG) {
368      if (!parseElementContent(eventType, xpp, res))
369        unknownContent(xpp);
370      eventType = nextNoWhitespace(xpp);
371    }
372    next(xpp);
373    parseElementClose(res);
374    return res;
375  }
376
377  protected boolean parseBackboneElementContent(int eventType, XmlPullParser xpp, BackboneElement res) throws XmlPullParserException, IOException, FHIRFormatError {
378    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
379      res.getModifierExtension().add(parseExtension(xpp));
380    } else if (!parseElementContent(eventType, xpp, res)){ 
381        return false;
382    }
383    return true;
384  }
385
386  protected boolean parseBackboneTypeContent(int eventType, XmlPullParser xpp, BackboneType res) throws XmlPullParserException, IOException, FHIRFormatError {
387    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
388      res.getModifierExtension().add(parseExtension(xpp));
389    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
390        return false;
391    }
392    return true;
393  }
394
395  protected boolean parseDataTypeContent(int eventType, XmlPullParser xpp, DataType res) throws XmlPullParserException, IOException, FHIRFormatError {
396    if (!parseElementContent(eventType, xpp, res)){ 
397        return false;
398    }
399    return true;
400  }
401
402  protected boolean parseElementContent(int eventType, XmlPullParser xpp, Element res) throws XmlPullParserException, IOException, FHIRFormatError {
403    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
404      res.getExtension().add(parseExtension(xpp));
405    } else if (!parseBaseContent(eventType, xpp, res)){ 
406        return false;
407    }
408    return true;
409  }
410
411  protected Address parseAddress(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
412    Address res = new Address();
413    parseElementAttributes(xpp, res);
414    next(xpp);
415    int eventType = nextNoWhitespace(xpp);
416    while (eventType != XmlPullParser.END_TAG) {
417    if (!parseAddressContent(eventType, xpp, res))
418        unknownContent(xpp);
419      eventType = nextNoWhitespace(xpp);
420    }
421    next(xpp);
422    parseElementClose(res);
423    return res;
424  }
425
426  protected boolean parseAddressContent(int eventType, XmlPullParser xpp, Address res) throws XmlPullParserException, IOException, FHIRFormatError {
427    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
428      res.setUseElement(parseEnumeration(xpp, Address.AddressUse.NULL, new Address.AddressUseEnumFactory()));
429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
430      res.setTypeElement(parseEnumeration(xpp, Address.AddressType.NULL, new Address.AddressTypeEnumFactory()));
431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
432      res.setTextElement(parseString(xpp));
433    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("line")) {
434      res.getLine().add(parseString(xpp));
435    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("city")) {
436      res.setCityElement(parseString(xpp));
437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("district")) {
438      res.setDistrictElement(parseString(xpp));
439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
440      res.setStateElement(parseString(xpp));
441    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("postalCode")) {
442      res.setPostalCodeElement(parseString(xpp));
443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
444      res.setCountryElement(parseString(xpp));
445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
446      res.setPeriod(parsePeriod(xpp));
447    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
448      return false;
449    }
450    return true;
451  }
452
453  protected Age parseAge(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
454    Age res = new Age();
455    parseElementAttributes(xpp, res);
456    next(xpp);
457    int eventType = nextNoWhitespace(xpp);
458    while (eventType != XmlPullParser.END_TAG) {
459    if (!parseAgeContent(eventType, xpp, res))
460        unknownContent(xpp);
461      eventType = nextNoWhitespace(xpp);
462    }
463    next(xpp);
464    parseElementClose(res);
465    return res;
466  }
467
468  protected boolean parseAgeContent(int eventType, XmlPullParser xpp, Age res) throws XmlPullParserException, IOException, FHIRFormatError {
469    if (!parseQuantityContent(eventType, xpp, res)){ 
470      return false;
471    }
472    return true;
473  }
474
475  protected Annotation parseAnnotation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
476    Annotation res = new Annotation();
477    parseElementAttributes(xpp, res);
478    next(xpp);
479    int eventType = nextNoWhitespace(xpp);
480    while (eventType != XmlPullParser.END_TAG) {
481    if (!parseAnnotationContent(eventType, xpp, res))
482        unknownContent(xpp);
483      eventType = nextNoWhitespace(xpp);
484    }
485    next(xpp);
486    parseElementClose(res);
487    return res;
488  }
489
490  protected boolean parseAnnotationContent(int eventType, XmlPullParser xpp, Annotation res) throws XmlPullParserException, IOException, FHIRFormatError {
491    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "author")) {
492      res.setAuthor(parseType("author", xpp));
493    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
494      res.setTimeElement(parseDateTime(xpp));
495    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
496      res.setTextElement(parseMarkdown(xpp));
497    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
498      return false;
499    }
500    return true;
501  }
502
503  protected Attachment parseAttachment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
504    Attachment res = new Attachment();
505    parseElementAttributes(xpp, res);
506    next(xpp);
507    int eventType = nextNoWhitespace(xpp);
508    while (eventType != XmlPullParser.END_TAG) {
509    if (!parseAttachmentContent(eventType, xpp, res))
510        unknownContent(xpp);
511      eventType = nextNoWhitespace(xpp);
512    }
513    next(xpp);
514    parseElementClose(res);
515    return res;
516  }
517
518  protected boolean parseAttachmentContent(int eventType, XmlPullParser xpp, Attachment res) throws XmlPullParserException, IOException, FHIRFormatError {
519    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
520      res.setContentTypeElement(parseCode(xpp));
521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
522      res.setLanguageElement(parseCode(xpp));
523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
524      res.setDataElement(parseBase64Binary(xpp));
525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
526      res.setUrlElement(parseUrl(xpp));
527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("size")) {
528      res.setSizeElement(parseInteger64(xpp));
529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hash")) {
530      res.setHashElement(parseBase64Binary(xpp));
531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
532      res.setTitleElement(parseString(xpp));
533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("creation")) {
534      res.setCreationElement(parseDateTime(xpp));
535    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("height")) {
536      res.setHeightElement(parsePositiveInt(xpp));
537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("width")) {
538      res.setWidthElement(parsePositiveInt(xpp));
539    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frames")) {
540      res.setFramesElement(parsePositiveInt(xpp));
541    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
542      res.setDurationElement(parseDecimal(xpp));
543    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pages")) {
544      res.setPagesElement(parsePositiveInt(xpp));
545    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
546      return false;
547    }
548    return true;
549  }
550
551  protected CodeableConcept parseCodeableConcept(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
552    CodeableConcept res = new CodeableConcept();
553    parseElementAttributes(xpp, res);
554    next(xpp);
555    int eventType = nextNoWhitespace(xpp);
556    while (eventType != XmlPullParser.END_TAG) {
557    if (!parseCodeableConceptContent(eventType, xpp, res))
558        unknownContent(xpp);
559      eventType = nextNoWhitespace(xpp);
560    }
561    next(xpp);
562    parseElementClose(res);
563    return res;
564  }
565
566  protected boolean parseCodeableConceptContent(int eventType, XmlPullParser xpp, CodeableConcept res) throws XmlPullParserException, IOException, FHIRFormatError {
567    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coding")) {
568      res.getCoding().add(parseCoding(xpp));
569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
570      res.setTextElement(parseString(xpp));
571    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
572      return false;
573    }
574    return true;
575  }
576
577  protected CodeableReference parseCodeableReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
578    CodeableReference res = new CodeableReference();
579    parseElementAttributes(xpp, res);
580    next(xpp);
581    int eventType = nextNoWhitespace(xpp);
582    while (eventType != XmlPullParser.END_TAG) {
583    if (!parseCodeableReferenceContent(eventType, xpp, res))
584        unknownContent(xpp);
585      eventType = nextNoWhitespace(xpp);
586    }
587    next(xpp);
588    parseElementClose(res);
589    return res;
590  }
591
592  protected boolean parseCodeableReferenceContent(int eventType, XmlPullParser xpp, CodeableReference res) throws XmlPullParserException, IOException, FHIRFormatError {
593    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
594      res.setConcept(parseCodeableConcept(xpp));
595    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
596      res.setReference(parseReference(xpp));
597    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
598      return false;
599    }
600    return true;
601  }
602
603  protected Coding parseCoding(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
604    Coding res = new Coding();
605    parseElementAttributes(xpp, res);
606    next(xpp);
607    int eventType = nextNoWhitespace(xpp);
608    while (eventType != XmlPullParser.END_TAG) {
609    if (!parseCodingContent(eventType, xpp, res))
610        unknownContent(xpp);
611      eventType = nextNoWhitespace(xpp);
612    }
613    next(xpp);
614    parseElementClose(res);
615    return res;
616  }
617
618  protected boolean parseCodingContent(int eventType, XmlPullParser xpp, Coding res) throws XmlPullParserException, IOException, FHIRFormatError {
619    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
620      res.setSystemElement(parseUri(xpp));
621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
622      res.setVersionElement(parseString(xpp));
623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
624      res.setCodeElement(parseCode(xpp));
625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
626      res.setDisplayElement(parseString(xpp));
627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userSelected")) {
628      res.setUserSelectedElement(parseBoolean(xpp));
629    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
630      return false;
631    }
632    return true;
633  }
634
635  protected ContactDetail parseContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
636    ContactDetail res = new ContactDetail();
637    parseElementAttributes(xpp, res);
638    next(xpp);
639    int eventType = nextNoWhitespace(xpp);
640    while (eventType != XmlPullParser.END_TAG) {
641    if (!parseContactDetailContent(eventType, xpp, res))
642        unknownContent(xpp);
643      eventType = nextNoWhitespace(xpp);
644    }
645    next(xpp);
646    parseElementClose(res);
647    return res;
648  }
649
650  protected boolean parseContactDetailContent(int eventType, XmlPullParser xpp, ContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
651    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
652      res.setNameElement(parseString(xpp));
653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
654      res.getTelecom().add(parseContactPoint(xpp));
655    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
656      return false;
657    }
658    return true;
659  }
660
661  protected ContactPoint parseContactPoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
662    ContactPoint res = new ContactPoint();
663    parseElementAttributes(xpp, res);
664    next(xpp);
665    int eventType = nextNoWhitespace(xpp);
666    while (eventType != XmlPullParser.END_TAG) {
667    if (!parseContactPointContent(eventType, xpp, res))
668        unknownContent(xpp);
669      eventType = nextNoWhitespace(xpp);
670    }
671    next(xpp);
672    parseElementClose(res);
673    return res;
674  }
675
676  protected boolean parseContactPointContent(int eventType, XmlPullParser xpp, ContactPoint res) throws XmlPullParserException, IOException, FHIRFormatError {
677    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
678      res.setSystemElement(parseEnumeration(xpp, ContactPoint.ContactPointSystem.NULL, new ContactPoint.ContactPointSystemEnumFactory()));
679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
680      res.setValueElement(parseString(xpp));
681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
682      res.setUseElement(parseEnumeration(xpp, ContactPoint.ContactPointUse.NULL, new ContactPoint.ContactPointUseEnumFactory()));
683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
684      res.setRankElement(parsePositiveInt(xpp));
685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
686      res.setPeriod(parsePeriod(xpp));
687    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
688      return false;
689    }
690    return true;
691  }
692
693  protected Contributor parseContributor(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
694    Contributor res = new Contributor();
695    parseElementAttributes(xpp, res);
696    next(xpp);
697    int eventType = nextNoWhitespace(xpp);
698    while (eventType != XmlPullParser.END_TAG) {
699    if (!parseContributorContent(eventType, xpp, res))
700        unknownContent(xpp);
701      eventType = nextNoWhitespace(xpp);
702    }
703    next(xpp);
704    parseElementClose(res);
705    return res;
706  }
707
708  protected boolean parseContributorContent(int eventType, XmlPullParser xpp, Contributor res) throws XmlPullParserException, IOException, FHIRFormatError {
709    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
710      res.setTypeElement(parseEnumeration(xpp, Contributor.ContributorType.NULL, new Contributor.ContributorTypeEnumFactory()));
711    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
712      res.setNameElement(parseString(xpp));
713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
714      res.getContact().add(parseContactDetail(xpp));
715    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
716      return false;
717    }
718    return true;
719  }
720
721  protected Count parseCount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
722    Count res = new Count();
723    parseElementAttributes(xpp, res);
724    next(xpp);
725    int eventType = nextNoWhitespace(xpp);
726    while (eventType != XmlPullParser.END_TAG) {
727    if (!parseCountContent(eventType, xpp, res))
728        unknownContent(xpp);
729      eventType = nextNoWhitespace(xpp);
730    }
731    next(xpp);
732    parseElementClose(res);
733    return res;
734  }
735
736  protected boolean parseCountContent(int eventType, XmlPullParser xpp, Count res) throws XmlPullParserException, IOException, FHIRFormatError {
737    if (!parseQuantityContent(eventType, xpp, res)){ 
738      return false;
739    }
740    return true;
741  }
742
743  protected DataRequirement parseDataRequirement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
744    DataRequirement res = new DataRequirement();
745    parseElementAttributes(xpp, res);
746    next(xpp);
747    int eventType = nextNoWhitespace(xpp);
748    while (eventType != XmlPullParser.END_TAG) {
749    if (!parseDataRequirementContent(eventType, xpp, res))
750        unknownContent(xpp);
751      eventType = nextNoWhitespace(xpp);
752    }
753    next(xpp);
754    parseElementClose(res);
755    return res;
756  }
757
758  protected boolean parseDataRequirementContent(int eventType, XmlPullParser xpp, DataRequirement res) throws XmlPullParserException, IOException, FHIRFormatError {
759    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
760      res.setTypeElement(parseEnumeration(xpp, Enumerations.FHIRAllTypes.NULL, new Enumerations.FHIRAllTypesEnumFactory()));
761    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
762      res.getProfile().add(parseCanonical(xpp));
763    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "subject")) {
764      res.setSubject(parseType("subject", xpp));
765    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
766      res.getMustSupport().add(parseString(xpp));
767    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeFilter")) {
768      res.getCodeFilter().add(parseDataRequirementCodeFilterComponent(xpp));
769    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateFilter")) {
770      res.getDateFilter().add(parseDataRequirementDateFilterComponent(xpp));
771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("limit")) {
772      res.setLimitElement(parsePositiveInt(xpp));
773    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sort")) {
774      res.getSort().add(parseDataRequirementSortComponent(xpp));
775    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
776      return false;
777    }
778    return true;
779  }
780
781  protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementCodeFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
782    DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent();
783    parseElementAttributes(xpp, res);
784    next(xpp);
785    int eventType = nextNoWhitespace(xpp);
786    while (eventType != XmlPullParser.END_TAG) {
787    if (!parseDataRequirementCodeFilterComponentContent(eventType, xpp, res))
788        unknownContent(xpp);
789      eventType = nextNoWhitespace(xpp);
790    }
791    next(xpp);
792    parseElementClose(res);
793    return res;
794  }
795
796  protected boolean parseDataRequirementCodeFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementCodeFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
797    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
798      res.setPathElement(parseString(xpp));
799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
800      res.setSearchParamElement(parseString(xpp));
801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
802      res.setValueSetElement(parseCanonical(xpp));
803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
804      res.getCode().add(parseCoding(xpp));
805    } else if (!parseElementContent(eventType, xpp, res)){ 
806      return false;
807    }
808    return true;
809  }
810
811  protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDateFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
812    DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent();
813    parseElementAttributes(xpp, res);
814    next(xpp);
815    int eventType = nextNoWhitespace(xpp);
816    while (eventType != XmlPullParser.END_TAG) {
817    if (!parseDataRequirementDateFilterComponentContent(eventType, xpp, res))
818        unknownContent(xpp);
819      eventType = nextNoWhitespace(xpp);
820    }
821    next(xpp);
822    parseElementClose(res);
823    return res;
824  }
825
826  protected boolean parseDataRequirementDateFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementDateFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
827    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
828      res.setPathElement(parseString(xpp));
829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
830      res.setSearchParamElement(parseString(xpp));
831    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
832      res.setValue(parseType("value", xpp));
833    } else if (!parseElementContent(eventType, xpp, res)){ 
834      return false;
835    }
836    return true;
837  }
838
839  protected DataRequirement.DataRequirementSortComponent parseDataRequirementSortComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
840    DataRequirement.DataRequirementSortComponent res = new DataRequirement.DataRequirementSortComponent();
841    parseElementAttributes(xpp, res);
842    next(xpp);
843    int eventType = nextNoWhitespace(xpp);
844    while (eventType != XmlPullParser.END_TAG) {
845    if (!parseDataRequirementSortComponentContent(eventType, xpp, res))
846        unknownContent(xpp);
847      eventType = nextNoWhitespace(xpp);
848    }
849    next(xpp);
850    parseElementClose(res);
851    return res;
852  }
853
854  protected boolean parseDataRequirementSortComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementSortComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
855    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
856      res.setPathElement(parseString(xpp));
857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("direction")) {
858      res.setDirectionElement(parseEnumeration(xpp, DataRequirement.SortDirection.NULL, new DataRequirement.SortDirectionEnumFactory()));
859    } else if (!parseElementContent(eventType, xpp, res)){ 
860      return false;
861    }
862    return true;
863  }
864
865  protected Distance parseDistance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
866    Distance res = new Distance();
867    parseElementAttributes(xpp, res);
868    next(xpp);
869    int eventType = nextNoWhitespace(xpp);
870    while (eventType != XmlPullParser.END_TAG) {
871    if (!parseDistanceContent(eventType, xpp, res))
872        unknownContent(xpp);
873      eventType = nextNoWhitespace(xpp);
874    }
875    next(xpp);
876    parseElementClose(res);
877    return res;
878  }
879
880  protected boolean parseDistanceContent(int eventType, XmlPullParser xpp, Distance res) throws XmlPullParserException, IOException, FHIRFormatError {
881    if (!parseQuantityContent(eventType, xpp, res)){ 
882      return false;
883    }
884    return true;
885  }
886
887  protected Dosage parseDosage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
888    Dosage res = new Dosage();
889    parseElementAttributes(xpp, res);
890    next(xpp);
891    int eventType = nextNoWhitespace(xpp);
892    while (eventType != XmlPullParser.END_TAG) {
893    if (!parseDosageContent(eventType, xpp, res))
894        unknownContent(xpp);
895      eventType = nextNoWhitespace(xpp);
896    }
897    next(xpp);
898    parseElementClose(res);
899    return res;
900  }
901
902  protected boolean parseDosageContent(int eventType, XmlPullParser xpp, Dosage res) throws XmlPullParserException, IOException, FHIRFormatError {
903    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
904      res.setSequenceElement(parseInteger(xpp));
905    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
906      res.setTextElement(parseString(xpp));
907    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInstruction")) {
908      res.getAdditionalInstruction().add(parseCodeableConcept(xpp));
909    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
910      res.setPatientInstructionElement(parseString(xpp));
911    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timing")) {
912      res.setTiming(parseTiming(xpp));
913    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
914      res.setAsNeeded(parseType("asNeeded", xpp));
915    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
916      res.setSite(parseCodeableConcept(xpp));
917    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
918      res.setRoute(parseCodeableConcept(xpp));
919    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
920      res.setMethod(parseCodeableConcept(xpp));
921    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseAndRate")) {
922      res.getDoseAndRate().add(parseDosageDoseAndRateComponent(xpp));
923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerPeriod")) {
924      res.setMaxDosePerPeriod(parseRatio(xpp));
925    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerAdministration")) {
926      res.setMaxDosePerAdministration(parseQuantity(xpp));
927    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) {
928      res.setMaxDosePerLifetime(parseQuantity(xpp));
929    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
930      return false;
931    }
932    return true;
933  }
934
935  protected Dosage.DosageDoseAndRateComponent parseDosageDoseAndRateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
936    Dosage.DosageDoseAndRateComponent res = new Dosage.DosageDoseAndRateComponent();
937    parseElementAttributes(xpp, res);
938    next(xpp);
939    int eventType = nextNoWhitespace(xpp);
940    while (eventType != XmlPullParser.END_TAG) {
941    if (!parseDosageDoseAndRateComponentContent(eventType, xpp, res))
942        unknownContent(xpp);
943      eventType = nextNoWhitespace(xpp);
944    }
945    next(xpp);
946    parseElementClose(res);
947    return res;
948  }
949
950  protected boolean parseDosageDoseAndRateComponentContent(int eventType, XmlPullParser xpp, Dosage.DosageDoseAndRateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
951    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
952      res.setType(parseCodeableConcept(xpp));
953    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "dose")) {
954      res.setDose(parseType("dose", xpp));
955    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
956      res.setRate(parseType("rate", xpp));
957    } else if (!parseElementContent(eventType, xpp, res)){ 
958      return false;
959    }
960    return true;
961  }
962
963  protected Duration parseDuration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
964    Duration res = new Duration();
965    parseElementAttributes(xpp, res);
966    next(xpp);
967    int eventType = nextNoWhitespace(xpp);
968    while (eventType != XmlPullParser.END_TAG) {
969    if (!parseDurationContent(eventType, xpp, res))
970        unknownContent(xpp);
971      eventType = nextNoWhitespace(xpp);
972    }
973    next(xpp);
974    parseElementClose(res);
975    return res;
976  }
977
978  protected boolean parseDurationContent(int eventType, XmlPullParser xpp, Duration res) throws XmlPullParserException, IOException, FHIRFormatError {
979    if (!parseQuantityContent(eventType, xpp, res)){ 
980      return false;
981    }
982    return true;
983  }
984
985  protected ElementDefinition parseElementDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
986    ElementDefinition res = new ElementDefinition();
987    parseElementAttributes(xpp, res);
988    next(xpp);
989    int eventType = nextNoWhitespace(xpp);
990    while (eventType != XmlPullParser.END_TAG) {
991    if (!parseElementDefinitionContent(eventType, xpp, res))
992        unknownContent(xpp);
993      eventType = nextNoWhitespace(xpp);
994    }
995    next(xpp);
996    parseElementClose(res);
997    return res;
998  }
999
1000  protected boolean parseElementDefinitionContent(int eventType, XmlPullParser xpp, ElementDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1001    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1002      res.setPathElement(parseString(xpp));
1003    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("representation")) {
1004      res.getRepresentation().add(parseEnumeration(xpp, ElementDefinition.PropertyRepresentation.NULL, new ElementDefinition.PropertyRepresentationEnumFactory()));
1005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
1006      res.setSliceNameElement(parseString(xpp));
1007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceIsConstraining")) {
1008      res.setSliceIsConstrainingElement(parseBoolean(xpp));
1009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1010      res.setLabelElement(parseString(xpp));
1011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1012      res.getCode().add(parseCoding(xpp));
1013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slicing")) {
1014      res.setSlicing(parseElementDefinitionSlicingComponent(xpp));
1015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("short")) {
1016      res.setShortElement(parseString(xpp));
1017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
1018      res.setDefinitionElement(parseMarkdown(xpp));
1019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1020      res.setCommentElement(parseMarkdown(xpp));
1021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1022      res.setRequirementsElement(parseMarkdown(xpp));
1023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
1024      res.getAlias().add(parseString(xpp));
1025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1026      res.setMinElement(parseUnsignedInt(xpp));
1027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1028      res.setMaxElement(parseString(xpp));
1029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
1030      res.setBase(parseElementDefinitionBaseComponent(xpp));
1031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentReference")) {
1032      res.setContentReferenceElement(parseUri(xpp));
1033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1034      res.getType().add(parseElementDefinitionTypeRefComponent(xpp));
1035    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
1036      res.setDefaultValue(parseType("defaultValue", xpp));
1037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaningWhenMissing")) {
1038      res.setMeaningWhenMissingElement(parseMarkdown(xpp));
1039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderMeaning")) {
1040      res.setOrderMeaningElement(parseString(xpp));
1041    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "fixed")) {
1042      res.setFixed(parseType("fixed", xpp));
1043    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "pattern")) {
1044      res.setPattern(parseType("pattern", xpp));
1045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
1046      res.getExample().add(parseElementDefinitionExampleComponent(xpp));
1047    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "minValue")) {
1048      res.setMinValue(parseType("minValue", xpp));
1049    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "maxValue")) {
1050      res.setMaxValue(parseType("maxValue", xpp));
1051    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
1052      res.setMaxLengthElement(parseInteger(xpp));
1053    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
1054      res.getCondition().add(parseId(xpp));
1055    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("constraint")) {
1056      res.getConstraint().add(parseElementDefinitionConstraintComponent(xpp));
1057    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1058      res.setMustSupportElement(parseBoolean(xpp));
1059    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifier")) {
1060      res.setIsModifierElement(parseBoolean(xpp));
1061    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifierReason")) {
1062      res.setIsModifierReasonElement(parseString(xpp));
1063    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isSummary")) {
1064      res.setIsSummaryElement(parseBoolean(xpp));
1065    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
1066      res.setBinding(parseElementDefinitionBindingComponent(xpp));
1067    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
1068      res.getMapping().add(parseElementDefinitionMappingComponent(xpp));
1069    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1070      return false;
1071    }
1072    return true;
1073  }
1074
1075  protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionSlicingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1076    ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent();
1077    parseElementAttributes(xpp, res);
1078    next(xpp);
1079    int eventType = nextNoWhitespace(xpp);
1080    while (eventType != XmlPullParser.END_TAG) {
1081    if (!parseElementDefinitionSlicingComponentContent(eventType, xpp, res))
1082        unknownContent(xpp);
1083      eventType = nextNoWhitespace(xpp);
1084    }
1085    next(xpp);
1086    parseElementClose(res);
1087    return res;
1088  }
1089
1090  protected boolean parseElementDefinitionSlicingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionSlicingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1091    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("discriminator")) {
1092      res.getDiscriminator().add(parseElementDefinitionSlicingDiscriminatorComponent(xpp));
1093    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1094      res.setDescriptionElement(parseString(xpp));
1095    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ordered")) {
1096      res.setOrderedElement(parseBoolean(xpp));
1097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rules")) {
1098      res.setRulesElement(parseEnumeration(xpp, ElementDefinition.SlicingRules.NULL, new ElementDefinition.SlicingRulesEnumFactory()));
1099    } else if (!parseElementContent(eventType, xpp, res)){ 
1100      return false;
1101    }
1102    return true;
1103  }
1104
1105  protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionSlicingDiscriminatorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1106    ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
1107    parseElementAttributes(xpp, res);
1108    next(xpp);
1109    int eventType = nextNoWhitespace(xpp);
1110    while (eventType != XmlPullParser.END_TAG) {
1111    if (!parseElementDefinitionSlicingDiscriminatorComponentContent(eventType, xpp, res))
1112        unknownContent(xpp);
1113      eventType = nextNoWhitespace(xpp);
1114    }
1115    next(xpp);
1116    parseElementClose(res);
1117    return res;
1118  }
1119
1120  protected boolean parseElementDefinitionSlicingDiscriminatorComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1121    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1122      res.setTypeElement(parseEnumeration(xpp, ElementDefinition.DiscriminatorType.NULL, new ElementDefinition.DiscriminatorTypeEnumFactory()));
1123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1124      res.setPathElement(parseString(xpp));
1125    } else if (!parseElementContent(eventType, xpp, res)){ 
1126      return false;
1127    }
1128    return true;
1129  }
1130
1131  protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionBaseComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1132    ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent();
1133    parseElementAttributes(xpp, res);
1134    next(xpp);
1135    int eventType = nextNoWhitespace(xpp);
1136    while (eventType != XmlPullParser.END_TAG) {
1137    if (!parseElementDefinitionBaseComponentContent(eventType, xpp, res))
1138        unknownContent(xpp);
1139      eventType = nextNoWhitespace(xpp);
1140    }
1141    next(xpp);
1142    parseElementClose(res);
1143    return res;
1144  }
1145
1146  protected boolean parseElementDefinitionBaseComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionBaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1147    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1148      res.setPathElement(parseString(xpp));
1149    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1150      res.setMinElement(parseUnsignedInt(xpp));
1151    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1152      res.setMaxElement(parseString(xpp));
1153    } else if (!parseElementContent(eventType, xpp, res)){ 
1154      return false;
1155    }
1156    return true;
1157  }
1158
1159  protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1160    ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent();
1161    parseElementAttributes(xpp, res);
1162    next(xpp);
1163    int eventType = nextNoWhitespace(xpp);
1164    while (eventType != XmlPullParser.END_TAG) {
1165    if (!parseElementDefinitionTypeRefComponentContent(eventType, xpp, res))
1166        unknownContent(xpp);
1167      eventType = nextNoWhitespace(xpp);
1168    }
1169    next(xpp);
1170    parseElementClose(res);
1171    return res;
1172  }
1173
1174  protected boolean parseElementDefinitionTypeRefComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.TypeRefComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1175    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1176      res.setCodeElement(parseUri(xpp));
1177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1178      res.getProfile().add(parseCanonical(xpp));
1179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetProfile")) {
1180      res.getTargetProfile().add(parseCanonical(xpp));
1181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregation")) {
1182      res.getAggregation().add(parseEnumeration(xpp, ElementDefinition.AggregationMode.NULL, new ElementDefinition.AggregationModeEnumFactory()));
1183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
1184      res.setVersioningElement(parseEnumeration(xpp, ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory()));
1185    } else if (!parseElementContent(eventType, xpp, res)){ 
1186      return false;
1187    }
1188    return true;
1189  }
1190
1191  protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionExampleComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1192    ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent();
1193    parseElementAttributes(xpp, res);
1194    next(xpp);
1195    int eventType = nextNoWhitespace(xpp);
1196    while (eventType != XmlPullParser.END_TAG) {
1197    if (!parseElementDefinitionExampleComponentContent(eventType, xpp, res))
1198        unknownContent(xpp);
1199      eventType = nextNoWhitespace(xpp);
1200    }
1201    next(xpp);
1202    parseElementClose(res);
1203    return res;
1204  }
1205
1206  protected boolean parseElementDefinitionExampleComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionExampleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1207    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1208      res.setLabelElement(parseString(xpp));
1209    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1210      res.setValue(parseType("value", xpp));
1211    } else if (!parseElementContent(eventType, xpp, res)){ 
1212      return false;
1213    }
1214    return true;
1215  }
1216
1217  protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionConstraintComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1218    ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent();
1219    parseElementAttributes(xpp, res);
1220    next(xpp);
1221    int eventType = nextNoWhitespace(xpp);
1222    while (eventType != XmlPullParser.END_TAG) {
1223    if (!parseElementDefinitionConstraintComponentContent(eventType, xpp, res))
1224        unknownContent(xpp);
1225      eventType = nextNoWhitespace(xpp);
1226    }
1227    next(xpp);
1228    parseElementClose(res);
1229    return res;
1230  }
1231
1232  protected boolean parseElementDefinitionConstraintComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionConstraintComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1233    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("key")) {
1234      res.setKeyElement(parseId(xpp));
1235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1236      res.setRequirementsElement(parseString(xpp));
1237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
1238      res.setSeverityElement(parseEnumeration(xpp, ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory()));
1239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("human")) {
1240      res.setHumanElement(parseString(xpp));
1241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1242      res.setExpressionElement(parseString(xpp));
1243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpath")) {
1244      res.setXpathElement(parseString(xpp));
1245    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1246      res.setSourceElement(parseCanonical(xpp));
1247    } else if (!parseElementContent(eventType, xpp, res)){ 
1248      return false;
1249    }
1250    return true;
1251  }
1252
1253  protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionBindingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1254    ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent();
1255    parseElementAttributes(xpp, res);
1256    next(xpp);
1257    int eventType = nextNoWhitespace(xpp);
1258    while (eventType != XmlPullParser.END_TAG) {
1259    if (!parseElementDefinitionBindingComponentContent(eventType, xpp, res))
1260        unknownContent(xpp);
1261      eventType = nextNoWhitespace(xpp);
1262    }
1263    next(xpp);
1264    parseElementClose(res);
1265    return res;
1266  }
1267
1268  protected boolean parseElementDefinitionBindingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1269    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
1270      res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
1271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1272      res.setDescriptionElement(parseString(xpp));
1273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
1274      res.setValueSetElement(parseCanonical(xpp));
1275    } else if (!parseElementContent(eventType, xpp, res)){ 
1276      return false;
1277    }
1278    return true;
1279  }
1280
1281  protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionMappingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1282    ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent();
1283    parseElementAttributes(xpp, res);
1284    next(xpp);
1285    int eventType = nextNoWhitespace(xpp);
1286    while (eventType != XmlPullParser.END_TAG) {
1287    if (!parseElementDefinitionMappingComponentContent(eventType, xpp, res))
1288        unknownContent(xpp);
1289      eventType = nextNoWhitespace(xpp);
1290    }
1291    next(xpp);
1292    parseElementClose(res);
1293    return res;
1294  }
1295
1296  protected boolean parseElementDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1297    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
1298      res.setIdentityElement(parseId(xpp));
1299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1300      res.setLanguageElement(parseCode(xpp));
1301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("map")) {
1302      res.setMapElement(parseString(xpp));
1303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1304      res.setCommentElement(parseString(xpp));
1305    } else if (!parseElementContent(eventType, xpp, res)){ 
1306      return false;
1307    }
1308    return true;
1309  }
1310
1311  protected Expression parseExpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1312    Expression res = new Expression();
1313    parseElementAttributes(xpp, res);
1314    next(xpp);
1315    int eventType = nextNoWhitespace(xpp);
1316    while (eventType != XmlPullParser.END_TAG) {
1317    if (!parseExpressionContent(eventType, xpp, res))
1318        unknownContent(xpp);
1319      eventType = nextNoWhitespace(xpp);
1320    }
1321    next(xpp);
1322    parseElementClose(res);
1323    return res;
1324  }
1325
1326  protected boolean parseExpressionContent(int eventType, XmlPullParser xpp, Expression res) throws XmlPullParserException, IOException, FHIRFormatError {
1327    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1328      res.setDescriptionElement(parseString(xpp));
1329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1330      res.setNameElement(parseId(xpp));
1331    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1332      res.setLanguageElement(parseCode(xpp));
1333    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1334      res.setExpressionElement(parseString(xpp));
1335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
1336      res.setReferenceElement(parseUri(xpp));
1337    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1338      return false;
1339    }
1340    return true;
1341  }
1342
1343  protected Extension parseExtension(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1344    Extension res = new Extension();
1345    parseElementAttributes(xpp, res);
1346    if (xpp.getAttributeValue(null, "url") != null)
1347        res.setUrl(xpp.getAttributeValue(null, "url"));
1348    next(xpp);
1349    int eventType = nextNoWhitespace(xpp);
1350    while (eventType != XmlPullParser.END_TAG) {
1351    if (!parseExtensionContent(eventType, xpp, res))
1352        unknownContent(xpp);
1353      eventType = nextNoWhitespace(xpp);
1354    }
1355    next(xpp);
1356    parseElementClose(res);
1357    return res;
1358  }
1359
1360  protected boolean parseExtensionContent(int eventType, XmlPullParser xpp, Extension res) throws XmlPullParserException, IOException, FHIRFormatError {
1361    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1362      res.setValue(parseType("value", xpp));
1363    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1364      return false;
1365    }
1366    return true;
1367  }
1368
1369  protected HumanName parseHumanName(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1370    HumanName res = new HumanName();
1371    parseElementAttributes(xpp, res);
1372    next(xpp);
1373    int eventType = nextNoWhitespace(xpp);
1374    while (eventType != XmlPullParser.END_TAG) {
1375    if (!parseHumanNameContent(eventType, xpp, res))
1376        unknownContent(xpp);
1377      eventType = nextNoWhitespace(xpp);
1378    }
1379    next(xpp);
1380    parseElementClose(res);
1381    return res;
1382  }
1383
1384  protected boolean parseHumanNameContent(int eventType, XmlPullParser xpp, HumanName res) throws XmlPullParserException, IOException, FHIRFormatError {
1385    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1386      res.setUseElement(parseEnumeration(xpp, HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory()));
1387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1388      res.setTextElement(parseString(xpp));
1389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("family")) {
1390      res.setFamilyElement(parseString(xpp));
1391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("given")) {
1392      res.getGiven().add(parseString(xpp));
1393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
1394      res.getPrefix().add(parseString(xpp));
1395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suffix")) {
1396      res.getSuffix().add(parseString(xpp));
1397    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1398      res.setPeriod(parsePeriod(xpp));
1399    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1400      return false;
1401    }
1402    return true;
1403  }
1404
1405  protected Identifier parseIdentifier(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1406    Identifier res = new Identifier();
1407    parseElementAttributes(xpp, res);
1408    next(xpp);
1409    int eventType = nextNoWhitespace(xpp);
1410    while (eventType != XmlPullParser.END_TAG) {
1411    if (!parseIdentifierContent(eventType, xpp, res))
1412        unknownContent(xpp);
1413      eventType = nextNoWhitespace(xpp);
1414    }
1415    next(xpp);
1416    parseElementClose(res);
1417    return res;
1418  }
1419
1420  protected boolean parseIdentifierContent(int eventType, XmlPullParser xpp, Identifier res) throws XmlPullParserException, IOException, FHIRFormatError {
1421    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1422      res.setUseElement(parseEnumeration(xpp, Identifier.IdentifierUse.NULL, new Identifier.IdentifierUseEnumFactory()));
1423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1424      res.setType(parseCodeableConcept(xpp));
1425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1426      res.setSystemElement(parseUri(xpp));
1427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1428      res.setValueElement(parseString(xpp));
1429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1430      res.setPeriod(parsePeriod(xpp));
1431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assigner")) {
1432      res.setAssigner(parseReference(xpp));
1433    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1434      return false;
1435    }
1436    return true;
1437  }
1438
1439  protected MarketingStatus parseMarketingStatus(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1440    MarketingStatus res = new MarketingStatus();
1441    parseElementAttributes(xpp, res);
1442    next(xpp);
1443    int eventType = nextNoWhitespace(xpp);
1444    while (eventType != XmlPullParser.END_TAG) {
1445    if (!parseMarketingStatusContent(eventType, xpp, res))
1446        unknownContent(xpp);
1447      eventType = nextNoWhitespace(xpp);
1448    }
1449    next(xpp);
1450    parseElementClose(res);
1451    return res;
1452  }
1453
1454  protected boolean parseMarketingStatusContent(int eventType, XmlPullParser xpp, MarketingStatus res) throws XmlPullParserException, IOException, FHIRFormatError {
1455    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
1456      res.setCountry(parseCodeableConcept(xpp));
1457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
1458      res.setJurisdiction(parseCodeableConcept(xpp));
1459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1460      res.setStatus(parseCodeableConcept(xpp));
1461    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateRange")) {
1462      res.setDateRange(parsePeriod(xpp));
1463    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("restoreDate")) {
1464      res.setRestoreDateElement(parseDateTime(xpp));
1465    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1466      return false;
1467    }
1468    return true;
1469  }
1470
1471  protected Meta parseMeta(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1472    Meta res = new Meta();
1473    parseElementAttributes(xpp, res);
1474    next(xpp);
1475    int eventType = nextNoWhitespace(xpp);
1476    while (eventType != XmlPullParser.END_TAG) {
1477    if (!parseMetaContent(eventType, xpp, res))
1478        unknownContent(xpp);
1479      eventType = nextNoWhitespace(xpp);
1480    }
1481    next(xpp);
1482    parseElementClose(res);
1483    return res;
1484  }
1485
1486  protected boolean parseMetaContent(int eventType, XmlPullParser xpp, Meta res) throws XmlPullParserException, IOException, FHIRFormatError {
1487    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionId")) {
1488      res.setVersionIdElement(parseId(xpp));
1489    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastUpdated")) {
1490      res.setLastUpdatedElement(parseInstant(xpp));
1491    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1492      res.setSourceElement(parseUri(xpp));
1493    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1494      res.getProfile().add(parseCanonical(xpp));
1495    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
1496      res.getSecurity().add(parseCoding(xpp));
1497    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
1498      res.getTag().add(parseCoding(xpp));
1499    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1500      return false;
1501    }
1502    return true;
1503  }
1504
1505  protected Money parseMoney(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1506    Money res = new Money();
1507    parseElementAttributes(xpp, res);
1508    next(xpp);
1509    int eventType = nextNoWhitespace(xpp);
1510    while (eventType != XmlPullParser.END_TAG) {
1511    if (!parseMoneyContent(eventType, xpp, res))
1512        unknownContent(xpp);
1513      eventType = nextNoWhitespace(xpp);
1514    }
1515    next(xpp);
1516    parseElementClose(res);
1517    return res;
1518  }
1519
1520  protected boolean parseMoneyContent(int eventType, XmlPullParser xpp, Money res) throws XmlPullParserException, IOException, FHIRFormatError {
1521    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1522      res.setValueElement(parseDecimal(xpp));
1523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currency")) {
1524      res.setCurrencyElement(parseCode(xpp));
1525    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1526      return false;
1527    }
1528    return true;
1529  }
1530
1531  protected Narrative parseNarrative(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1532    Narrative res = new Narrative();
1533    parseElementAttributes(xpp, res);
1534    next(xpp);
1535    int eventType = nextNoWhitespace(xpp);
1536    while (eventType != XmlPullParser.END_TAG) {
1537    if (!parseNarrativeContent(eventType, xpp, res))
1538        unknownContent(xpp);
1539      eventType = nextNoWhitespace(xpp);
1540    }
1541    next(xpp);
1542    parseElementClose(res);
1543    return res;
1544  }
1545
1546  protected boolean parseNarrativeContent(int eventType, XmlPullParser xpp, Narrative res) throws XmlPullParserException, IOException, FHIRFormatError {
1547    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1548      res.setStatusElement(parseEnumeration(xpp, Narrative.NarrativeStatus.NULL, new Narrative.NarrativeStatusEnumFactory()));
1549    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("div")) {
1550      res.setDiv(parseXhtml(xpp));
1551    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1552      return false;
1553    }
1554    return true;
1555  }
1556
1557  protected ParameterDefinition parseParameterDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1558    ParameterDefinition res = new ParameterDefinition();
1559    parseElementAttributes(xpp, res);
1560    next(xpp);
1561    int eventType = nextNoWhitespace(xpp);
1562    while (eventType != XmlPullParser.END_TAG) {
1563    if (!parseParameterDefinitionContent(eventType, xpp, res))
1564        unknownContent(xpp);
1565      eventType = nextNoWhitespace(xpp);
1566    }
1567    next(xpp);
1568    parseElementClose(res);
1569    return res;
1570  }
1571
1572  protected boolean parseParameterDefinitionContent(int eventType, XmlPullParser xpp, ParameterDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1573    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1574      res.setNameElement(parseCode(xpp));
1575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1576      res.setUseElement(parseEnumeration(xpp, Enumerations.OperationParameterUse.NULL, new Enumerations.OperationParameterUseEnumFactory()));
1577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1578      res.setMinElement(parseInteger(xpp));
1579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1580      res.setMaxElement(parseString(xpp));
1581    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1582      res.setDocumentationElement(parseString(xpp));
1583    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1584      res.setTypeElement(parseEnumeration(xpp, Enumerations.FHIRAllTypes.NULL, new Enumerations.FHIRAllTypesEnumFactory()));
1585    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1586      res.setProfileElement(parseCanonical(xpp));
1587    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1588      return false;
1589    }
1590    return true;
1591  }
1592
1593  protected Period parsePeriod(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1594    Period res = new Period();
1595    parseElementAttributes(xpp, res);
1596    next(xpp);
1597    int eventType = nextNoWhitespace(xpp);
1598    while (eventType != XmlPullParser.END_TAG) {
1599    if (!parsePeriodContent(eventType, xpp, res))
1600        unknownContent(xpp);
1601      eventType = nextNoWhitespace(xpp);
1602    }
1603    next(xpp);
1604    parseElementClose(res);
1605    return res;
1606  }
1607
1608  protected boolean parsePeriodContent(int eventType, XmlPullParser xpp, Period res) throws XmlPullParserException, IOException, FHIRFormatError {
1609    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
1610      res.setStartElement(parseDateTime(xpp));
1611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
1612      res.setEndElement(parseDateTime(xpp));
1613    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1614      return false;
1615    }
1616    return true;
1617  }
1618
1619  protected Population parsePopulation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1620    Population res = new Population();
1621    parseElementAttributes(xpp, res);
1622    next(xpp);
1623    int eventType = nextNoWhitespace(xpp);
1624    while (eventType != XmlPullParser.END_TAG) {
1625    if (!parsePopulationContent(eventType, xpp, res))
1626        unknownContent(xpp);
1627      eventType = nextNoWhitespace(xpp);
1628    }
1629    next(xpp);
1630    parseElementClose(res);
1631    return res;
1632  }
1633
1634  protected boolean parsePopulationContent(int eventType, XmlPullParser xpp, Population res) throws XmlPullParserException, IOException, FHIRFormatError {
1635    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "age")) {
1636      res.setAge(parseType("age", xpp));
1637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("gender")) {
1638      res.setGender(parseCodeableConcept(xpp));
1639    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("race")) {
1640      res.setRace(parseCodeableConcept(xpp));
1641    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("physiologicalCondition")) {
1642      res.setPhysiologicalCondition(parseCodeableConcept(xpp));
1643    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1644      return false;
1645    }
1646    return true;
1647  }
1648
1649  protected ProdCharacteristic parseProdCharacteristic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1650    ProdCharacteristic res = new ProdCharacteristic();
1651    parseElementAttributes(xpp, res);
1652    next(xpp);
1653    int eventType = nextNoWhitespace(xpp);
1654    while (eventType != XmlPullParser.END_TAG) {
1655    if (!parseProdCharacteristicContent(eventType, xpp, res))
1656        unknownContent(xpp);
1657      eventType = nextNoWhitespace(xpp);
1658    }
1659    next(xpp);
1660    parseElementClose(res);
1661    return res;
1662  }
1663
1664  protected boolean parseProdCharacteristicContent(int eventType, XmlPullParser xpp, ProdCharacteristic res) throws XmlPullParserException, IOException, FHIRFormatError {
1665    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("height")) {
1666      res.setHeight(parseQuantity(xpp));
1667    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("width")) {
1668      res.setWidth(parseQuantity(xpp));
1669    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("depth")) {
1670      res.setDepth(parseQuantity(xpp));
1671    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("weight")) {
1672      res.setWeight(parseQuantity(xpp));
1673    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("nominalVolume")) {
1674      res.setNominalVolume(parseQuantity(xpp));
1675    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("externalDiameter")) {
1676      res.setExternalDiameter(parseQuantity(xpp));
1677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("shape")) {
1678      res.setShapeElement(parseString(xpp));
1679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("color")) {
1680      res.getColor().add(parseString(xpp));
1681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imprint")) {
1682      res.getImprint().add(parseString(xpp));
1683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
1684      res.getImage().add(parseAttachment(xpp));
1685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("scoring")) {
1686      res.setScoring(parseCodeableConcept(xpp));
1687    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1688      return false;
1689    }
1690    return true;
1691  }
1692
1693  protected ProductShelfLife parseProductShelfLife(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1694    ProductShelfLife res = new ProductShelfLife();
1695    parseElementAttributes(xpp, res);
1696    next(xpp);
1697    int eventType = nextNoWhitespace(xpp);
1698    while (eventType != XmlPullParser.END_TAG) {
1699    if (!parseProductShelfLifeContent(eventType, xpp, res))
1700        unknownContent(xpp);
1701      eventType = nextNoWhitespace(xpp);
1702    }
1703    next(xpp);
1704    parseElementClose(res);
1705    return res;
1706  }
1707
1708  protected boolean parseProductShelfLifeContent(int eventType, XmlPullParser xpp, ProductShelfLife res) throws XmlPullParserException, IOException, FHIRFormatError {
1709    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1710      res.setType(parseCodeableConcept(xpp));
1711    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "period")) {
1712      res.setPeriod(parseType("period", xpp));
1713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialPrecautionsForStorage")) {
1714      res.getSpecialPrecautionsForStorage().add(parseCodeableConcept(xpp));
1715    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1716      return false;
1717    }
1718    return true;
1719  }
1720
1721  protected Quantity parseQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1722    Quantity res = new Quantity();
1723    parseElementAttributes(xpp, res);
1724    next(xpp);
1725    int eventType = nextNoWhitespace(xpp);
1726    while (eventType != XmlPullParser.END_TAG) {
1727    if (!parseQuantityContent(eventType, xpp, res))
1728        unknownContent(xpp);
1729      eventType = nextNoWhitespace(xpp);
1730    }
1731    next(xpp);
1732    parseElementClose(res);
1733    return res;
1734  }
1735
1736  protected boolean parseQuantityContent(int eventType, XmlPullParser xpp, Quantity res) throws XmlPullParserException, IOException, FHIRFormatError {
1737    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1738      res.setValueElement(parseDecimal(xpp));
1739    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
1740      res.setComparatorElement(parseEnumeration(xpp, Enumerations.QuantityComparator.NULL, new Enumerations.QuantityComparatorEnumFactory()));
1741    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
1742      res.setUnitElement(parseString(xpp));
1743    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1744      res.setSystemElement(parseUri(xpp));
1745    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1746      res.setCodeElement(parseCode(xpp));
1747    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1748      return false;
1749    }
1750    return true;
1751  }
1752
1753  protected Range parseRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1754    Range res = new Range();
1755    parseElementAttributes(xpp, res);
1756    next(xpp);
1757    int eventType = nextNoWhitespace(xpp);
1758    while (eventType != XmlPullParser.END_TAG) {
1759    if (!parseRangeContent(eventType, xpp, res))
1760        unknownContent(xpp);
1761      eventType = nextNoWhitespace(xpp);
1762    }
1763    next(xpp);
1764    parseElementClose(res);
1765    return res;
1766  }
1767
1768  protected boolean parseRangeContent(int eventType, XmlPullParser xpp, Range res) throws XmlPullParserException, IOException, FHIRFormatError {
1769    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
1770      res.setLow(parseQuantity(xpp));
1771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
1772      res.setHigh(parseQuantity(xpp));
1773    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1774      return false;
1775    }
1776    return true;
1777  }
1778
1779  protected Ratio parseRatio(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1780    Ratio res = new Ratio();
1781    parseElementAttributes(xpp, res);
1782    next(xpp);
1783    int eventType = nextNoWhitespace(xpp);
1784    while (eventType != XmlPullParser.END_TAG) {
1785    if (!parseRatioContent(eventType, xpp, res))
1786        unknownContent(xpp);
1787      eventType = nextNoWhitespace(xpp);
1788    }
1789    next(xpp);
1790    parseElementClose(res);
1791    return res;
1792  }
1793
1794  protected boolean parseRatioContent(int eventType, XmlPullParser xpp, Ratio res) throws XmlPullParserException, IOException, FHIRFormatError {
1795    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numerator")) {
1796      res.setNumerator(parseQuantity(xpp));
1797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
1798      res.setDenominator(parseQuantity(xpp));
1799    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1800      return false;
1801    }
1802    return true;
1803  }
1804
1805  protected RatioRange parseRatioRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1806    RatioRange res = new RatioRange();
1807    parseElementAttributes(xpp, res);
1808    next(xpp);
1809    int eventType = nextNoWhitespace(xpp);
1810    while (eventType != XmlPullParser.END_TAG) {
1811    if (!parseRatioRangeContent(eventType, xpp, res))
1812        unknownContent(xpp);
1813      eventType = nextNoWhitespace(xpp);
1814    }
1815    next(xpp);
1816    parseElementClose(res);
1817    return res;
1818  }
1819
1820  protected boolean parseRatioRangeContent(int eventType, XmlPullParser xpp, RatioRange res) throws XmlPullParserException, IOException, FHIRFormatError {
1821    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowNumerator")) {
1822      res.setLowNumerator(parseQuantity(xpp));
1823    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("highNumerator")) {
1824      res.setHighNumerator(parseQuantity(xpp));
1825    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
1826      res.setDenominator(parseQuantity(xpp));
1827    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1828      return false;
1829    }
1830    return true;
1831  }
1832
1833  protected Reference parseReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1834    Reference res = new Reference();
1835    parseElementAttributes(xpp, res);
1836    next(xpp);
1837    int eventType = nextNoWhitespace(xpp);
1838    while (eventType != XmlPullParser.END_TAG) {
1839    if (!parseReferenceContent(eventType, xpp, res))
1840        unknownContent(xpp);
1841      eventType = nextNoWhitespace(xpp);
1842    }
1843    next(xpp);
1844    parseElementClose(res);
1845    return res;
1846  }
1847
1848  protected boolean parseReferenceContent(int eventType, XmlPullParser xpp, Reference res) throws XmlPullParserException, IOException, FHIRFormatError {
1849    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
1850      res.setReferenceElement(parseString(xpp));
1851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1852      res.setTypeElement(parseUri(xpp));
1853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1854      res.setIdentifier(parseIdentifier(xpp));
1855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
1856      res.setDisplayElement(parseString(xpp));
1857    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1858      return false;
1859    }
1860    return true;
1861  }
1862
1863  protected RelatedArtifact parseRelatedArtifact(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1864    RelatedArtifact res = new RelatedArtifact();
1865    parseElementAttributes(xpp, res);
1866    next(xpp);
1867    int eventType = nextNoWhitespace(xpp);
1868    while (eventType != XmlPullParser.END_TAG) {
1869    if (!parseRelatedArtifactContent(eventType, xpp, res))
1870        unknownContent(xpp);
1871      eventType = nextNoWhitespace(xpp);
1872    }
1873    next(xpp);
1874    parseElementClose(res);
1875    return res;
1876  }
1877
1878  protected boolean parseRelatedArtifactContent(int eventType, XmlPullParser xpp, RelatedArtifact res) throws XmlPullParserException, IOException, FHIRFormatError {
1879    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1880      res.setTypeElement(parseEnumeration(xpp, RelatedArtifact.RelatedArtifactType.NULL, new RelatedArtifact.RelatedArtifactTypeEnumFactory()));
1881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
1882      res.getClassifier().add(parseCodeableConcept(xpp));
1883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1884      res.setLabelElement(parseString(xpp));
1885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
1886      res.setDisplayElement(parseString(xpp));
1887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
1888      res.setCitationElement(parseMarkdown(xpp));
1889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
1890      res.setDocument(parseAttachment(xpp));
1891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1892      res.setResourceElement(parseCanonical(xpp));
1893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceReference")) {
1894      res.setResourceReference(parseReference(xpp));
1895    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1896      return false;
1897    }
1898    return true;
1899  }
1900
1901  protected SampledData parseSampledData(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1902    SampledData res = new SampledData();
1903    parseElementAttributes(xpp, res);
1904    next(xpp);
1905    int eventType = nextNoWhitespace(xpp);
1906    while (eventType != XmlPullParser.END_TAG) {
1907    if (!parseSampledDataContent(eventType, xpp, res))
1908        unknownContent(xpp);
1909      eventType = nextNoWhitespace(xpp);
1910    }
1911    next(xpp);
1912    parseElementClose(res);
1913    return res;
1914  }
1915
1916  protected boolean parseSampledDataContent(int eventType, XmlPullParser xpp, SampledData res) throws XmlPullParserException, IOException, FHIRFormatError {
1917    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
1918      res.setOrigin(parseQuantity(xpp));
1919    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1920      res.setPeriodElement(parseDecimal(xpp));
1921    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
1922      res.setFactorElement(parseDecimal(xpp));
1923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowerLimit")) {
1924      res.setLowerLimitElement(parseDecimal(xpp));
1925    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("upperLimit")) {
1926      res.setUpperLimitElement(parseDecimal(xpp));
1927    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dimensions")) {
1928      res.setDimensionsElement(parsePositiveInt(xpp));
1929    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
1930      res.setDataElement(parseString(xpp));
1931    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1932      return false;
1933    }
1934    return true;
1935  }
1936
1937  protected Signature parseSignature(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1938    Signature res = new Signature();
1939    parseElementAttributes(xpp, res);
1940    next(xpp);
1941    int eventType = nextNoWhitespace(xpp);
1942    while (eventType != XmlPullParser.END_TAG) {
1943    if (!parseSignatureContent(eventType, xpp, res))
1944        unknownContent(xpp);
1945      eventType = nextNoWhitespace(xpp);
1946    }
1947    next(xpp);
1948    parseElementClose(res);
1949    return res;
1950  }
1951
1952  protected boolean parseSignatureContent(int eventType, XmlPullParser xpp, Signature res) throws XmlPullParserException, IOException, FHIRFormatError {
1953    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1954      res.getType().add(parseCoding(xpp));
1955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
1956      res.setWhenElement(parseInstant(xpp));
1957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("who")) {
1958      res.setWho(parseReference(xpp));
1959    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
1960      res.setOnBehalfOf(parseReference(xpp));
1961    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetFormat")) {
1962      res.setTargetFormatElement(parseCode(xpp));
1963    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sigFormat")) {
1964      res.setSigFormatElement(parseCode(xpp));
1965    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
1966      res.setDataElement(parseBase64Binary(xpp));
1967    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1968      return false;
1969    }
1970    return true;
1971  }
1972
1973  protected Timing parseTiming(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1974    Timing res = new Timing();
1975    parseElementAttributes(xpp, res);
1976    next(xpp);
1977    int eventType = nextNoWhitespace(xpp);
1978    while (eventType != XmlPullParser.END_TAG) {
1979    if (!parseTimingContent(eventType, xpp, res))
1980        unknownContent(xpp);
1981      eventType = nextNoWhitespace(xpp);
1982    }
1983    next(xpp);
1984    parseElementClose(res);
1985    return res;
1986  }
1987
1988  protected boolean parseTimingContent(int eventType, XmlPullParser xpp, Timing res) throws XmlPullParserException, IOException, FHIRFormatError {
1989    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
1990      res.getEvent().add(parseDateTime(xpp));
1991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeat")) {
1992      res.setRepeat(parseTimingRepeatComponent(xpp));
1993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1994      res.setCode(parseCodeableConcept(xpp));
1995    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1996      return false;
1997    }
1998    return true;
1999  }
2000
2001  protected Timing.TimingRepeatComponent parseTimingRepeatComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2002    Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent();
2003    parseElementAttributes(xpp, res);
2004    next(xpp);
2005    int eventType = nextNoWhitespace(xpp);
2006    while (eventType != XmlPullParser.END_TAG) {
2007    if (!parseTimingRepeatComponentContent(eventType, xpp, res))
2008        unknownContent(xpp);
2009      eventType = nextNoWhitespace(xpp);
2010    }
2011    next(xpp);
2012    parseElementClose(res);
2013    return res;
2014  }
2015
2016  protected boolean parseTimingRepeatComponentContent(int eventType, XmlPullParser xpp, Timing.TimingRepeatComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2017    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "bounds")) {
2018      res.setBounds(parseType("bounds", xpp));
2019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
2020      res.setCountElement(parsePositiveInt(xpp));
2021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("countMax")) {
2022      res.setCountMaxElement(parsePositiveInt(xpp));
2023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
2024      res.setDurationElement(parseDecimal(xpp));
2025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationMax")) {
2026      res.setDurationMaxElement(parseDecimal(xpp));
2027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationUnit")) {
2028      res.setDurationUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
2029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequency")) {
2030      res.setFrequencyElement(parsePositiveInt(xpp));
2031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyMax")) {
2032      res.setFrequencyMaxElement(parsePositiveInt(xpp));
2033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
2034      res.setPeriodElement(parseDecimal(xpp));
2035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodMax")) {
2036      res.setPeriodMaxElement(parseDecimal(xpp));
2037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodUnit")) {
2038      res.setPeriodUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
2039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
2040      res.getDayOfWeek().add(parseEnumeration(xpp, Enumerations.DaysOfWeek.NULL, new Enumerations.DaysOfWeekEnumFactory()));
2041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timeOfDay")) {
2042      res.getTimeOfDay().add(parseTime(xpp));
2043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
2044      res.getWhen().add(parseEnumeration(xpp, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory()));
2045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
2046      res.setOffsetElement(parseUnsignedInt(xpp));
2047    } else if (!parseElementContent(eventType, xpp, res)){ 
2048      return false;
2049    }
2050    return true;
2051  }
2052
2053  protected TriggerDefinition parseTriggerDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2054    TriggerDefinition res = new TriggerDefinition();
2055    parseElementAttributes(xpp, res);
2056    next(xpp);
2057    int eventType = nextNoWhitespace(xpp);
2058    while (eventType != XmlPullParser.END_TAG) {
2059    if (!parseTriggerDefinitionContent(eventType, xpp, res))
2060        unknownContent(xpp);
2061      eventType = nextNoWhitespace(xpp);
2062    }
2063    next(xpp);
2064    parseElementClose(res);
2065    return res;
2066  }
2067
2068  protected boolean parseTriggerDefinitionContent(int eventType, XmlPullParser xpp, TriggerDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2069    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2070      res.setTypeElement(parseEnumeration(xpp, TriggerDefinition.TriggerType.NULL, new TriggerDefinition.TriggerTypeEnumFactory()));
2071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2072      res.setNameElement(parseString(xpp));
2073    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
2074      res.setTiming(parseType("timing", xpp));
2075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
2076      res.getData().add(parseDataRequirement(xpp));
2077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
2078      res.setCondition(parseExpression(xpp));
2079    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2080      return false;
2081    }
2082    return true;
2083  }
2084
2085  protected UsageContext parseUsageContext(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2086    UsageContext res = new UsageContext();
2087    parseElementAttributes(xpp, res);
2088    next(xpp);
2089    int eventType = nextNoWhitespace(xpp);
2090    while (eventType != XmlPullParser.END_TAG) {
2091    if (!parseUsageContextContent(eventType, xpp, res))
2092        unknownContent(xpp);
2093      eventType = nextNoWhitespace(xpp);
2094    }
2095    next(xpp);
2096    parseElementClose(res);
2097    return res;
2098  }
2099
2100  protected boolean parseUsageContextContent(int eventType, XmlPullParser xpp, UsageContext res) throws XmlPullParserException, IOException, FHIRFormatError {
2101    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2102      res.setCode(parseCoding(xpp));
2103    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
2104      res.setValue(parseType("value", xpp));
2105    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2106      return false;
2107    }
2108    return true;
2109  }
2110
2111  protected boolean parseCanonicalResourceContent(int eventType, XmlPullParser xpp, CanonicalResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2112    if (!parseDomainResourceContent(eventType, xpp, res)){ 
2113        return false;
2114    }
2115    return true;
2116  }
2117
2118  protected boolean parseDomainResourceContent(int eventType, XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2119    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
2120      res.setText(parseNarrative(xpp));
2121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contained")) {
2122      res.getContained().add(parseResourceContained(xpp));
2123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
2124      res.getExtension().add(parseExtension(xpp));
2125    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
2126      res.getModifierExtension().add(parseExtension(xpp));
2127    } else if (!parseResourceContent(eventType, xpp, res)){ 
2128        return false;
2129    }
2130    return true;
2131  }
2132
2133  protected boolean parseMetadataResourceContent(int eventType, XmlPullParser xpp, MetadataResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2134    if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
2135        return false;
2136    }
2137    return true;
2138  }
2139
2140  protected boolean parseResourceContent(int eventType, XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
2141    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("id")) {
2142      res.setIdElement(parseId(xpp));
2143    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meta")) {
2144      res.setMeta(parseMeta(xpp));
2145    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicitRules")) {
2146      res.setImplicitRulesElement(parseUri(xpp));
2147    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
2148      res.setLanguageElement(parseCode(xpp));
2149    } else if (!parseBaseContent(eventType, xpp, res)){ 
2150        return false;
2151    }
2152    return true;
2153  }
2154
2155  protected Account parseAccount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2156    Account res = new Account();
2157    parseResourceAttributes(xpp, res);
2158    next(xpp);
2159    int eventType = nextNoWhitespace(xpp);
2160    while (eventType != XmlPullParser.END_TAG) {
2161    if (!parseAccountContent(eventType, xpp, res))
2162        unknownContent(xpp);
2163      eventType = nextNoWhitespace(xpp);
2164    }
2165    next(xpp);
2166    parseElementClose(res);
2167    return res;
2168  }
2169
2170  protected boolean parseAccountContent(int eventType, XmlPullParser xpp, Account res) throws XmlPullParserException, IOException, FHIRFormatError {
2171    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2172      res.getIdentifier().add(parseIdentifier(xpp));
2173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2174      res.setStatusElement(parseEnumeration(xpp, Account.AccountStatus.NULL, new Account.AccountStatusEnumFactory()));
2175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billingStatus")) {
2176      res.setBillingStatus(parseCodeableConcept(xpp));
2177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2178      res.setType(parseCodeableConcept(xpp));
2179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2180      res.setNameElement(parseString(xpp));
2181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2182      res.getSubject().add(parseReference(xpp));
2183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("servicePeriod")) {
2184      res.setServicePeriod(parsePeriod(xpp));
2185    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
2186      res.getCoverage().add(parseAccountCoverageComponent(xpp));
2187    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
2188      res.setOwner(parseReference(xpp));
2189    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2190      res.setDescriptionElement(parseString(xpp));
2191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guarantor")) {
2192      res.getGuarantor().add(parseAccountGuarantorComponent(xpp));
2193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
2194      res.setPartOf(parseReference(xpp));
2195    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2196      return false;
2197    }
2198    return true;
2199  }
2200
2201  protected Account.CoverageComponent parseAccountCoverageComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2202    Account.CoverageComponent res = new Account.CoverageComponent();
2203    parseElementAttributes(xpp, res);
2204    next(xpp);
2205    int eventType = nextNoWhitespace(xpp);
2206    while (eventType != XmlPullParser.END_TAG) {
2207    if (!parseAccountCoverageComponentContent(eventType, xpp, res))
2208        unknownContent(xpp);
2209      eventType = nextNoWhitespace(xpp);
2210    }
2211    next(xpp);
2212    parseElementClose(res);
2213    return res;
2214  }
2215
2216  protected boolean parseAccountCoverageComponentContent(int eventType, XmlPullParser xpp, Account.CoverageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2217    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
2218      res.setCoverage(parseReference(xpp));
2219    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2220      res.setPriorityElement(parsePositiveInt(xpp));
2221    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2222      return false;
2223    }
2224    return true;
2225  }
2226
2227  protected Account.GuarantorComponent parseAccountGuarantorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2228    Account.GuarantorComponent res = new Account.GuarantorComponent();
2229    parseElementAttributes(xpp, res);
2230    next(xpp);
2231    int eventType = nextNoWhitespace(xpp);
2232    while (eventType != XmlPullParser.END_TAG) {
2233    if (!parseAccountGuarantorComponentContent(eventType, xpp, res))
2234        unknownContent(xpp);
2235      eventType = nextNoWhitespace(xpp);
2236    }
2237    next(xpp);
2238    parseElementClose(res);
2239    return res;
2240  }
2241
2242  protected boolean parseAccountGuarantorComponentContent(int eventType, XmlPullParser xpp, Account.GuarantorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2243    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
2244      res.setParty(parseReference(xpp));
2245    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onHold")) {
2246      res.setOnHoldElement(parseBoolean(xpp));
2247    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
2248      res.setPeriod(parsePeriod(xpp));
2249    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2250      return false;
2251    }
2252    return true;
2253  }
2254
2255  protected ActivityDefinition parseActivityDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2256    ActivityDefinition res = new ActivityDefinition();
2257    parseResourceAttributes(xpp, res);
2258    next(xpp);
2259    int eventType = nextNoWhitespace(xpp);
2260    while (eventType != XmlPullParser.END_TAG) {
2261    if (!parseActivityDefinitionContent(eventType, xpp, res))
2262        unknownContent(xpp);
2263      eventType = nextNoWhitespace(xpp);
2264    }
2265    next(xpp);
2266    parseElementClose(res);
2267    return res;
2268  }
2269
2270  protected boolean parseActivityDefinitionContent(int eventType, XmlPullParser xpp, ActivityDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2271    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2272      res.setUrlElement(parseUri(xpp));
2273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2274      res.getIdentifier().add(parseIdentifier(xpp));
2275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2276      res.setVersionElement(parseString(xpp));
2277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2278      res.setNameElement(parseString(xpp));
2279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2280      res.setTitleElement(parseString(xpp));
2281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtitle")) {
2282      res.setSubtitleElement(parseString(xpp));
2283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2284      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2286      res.setExperimentalElement(parseBoolean(xpp));
2287    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "subject")) {
2288      res.setSubject(parseType("subject", xpp));
2289    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2290      res.setDateElement(parseDateTime(xpp));
2291    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2292      res.setPublisherElement(parseString(xpp));
2293    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2294      res.getContact().add(parseContactDetail(xpp));
2295    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2296      res.setDescriptionElement(parseMarkdown(xpp));
2297    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2298      res.getUseContext().add(parseUsageContext(xpp));
2299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2300      res.getJurisdiction().add(parseCodeableConcept(xpp));
2301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2302      res.setPurposeElement(parseMarkdown(xpp));
2303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
2304      res.setUsageElement(parseString(xpp));
2305    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2306      res.setCopyrightElement(parseMarkdown(xpp));
2307    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
2308      res.setApprovalDateElement(parseDate(xpp));
2309    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
2310      res.setLastReviewDateElement(parseDate(xpp));
2311    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
2312      res.setEffectivePeriod(parsePeriod(xpp));
2313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
2314      res.getTopic().add(parseCodeableConcept(xpp));
2315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2316      res.getAuthor().add(parseContactDetail(xpp));
2317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
2318      res.getEditor().add(parseContactDetail(xpp));
2319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
2320      res.getReviewer().add(parseContactDetail(xpp));
2321    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
2322      res.getEndorser().add(parseContactDetail(xpp));
2323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
2324      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
2325    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
2326      res.getLibrary().add(parseCanonical(xpp));
2327    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
2328      res.setKindElement(parseEnumeration(xpp, ActivityDefinition.RequestResourceType.NULL, new ActivityDefinition.RequestResourceTypeEnumFactory()));
2329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
2330      res.setProfileElement(parseCanonical(xpp));
2331    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2332      res.setCode(parseCodeableConcept(xpp));
2333    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
2334      res.setIntentElement(parseEnumeration(xpp, Enumerations.RequestIntent.NULL, new Enumerations.RequestIntentEnumFactory()));
2335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2336      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
2337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
2338      res.setDoNotPerformElement(parseBoolean(xpp));
2339    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
2340      res.setTiming(parseType("timing", xpp));
2341    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2342      res.setLocation(parseCodeableReference(xpp));
2343    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2344      res.getParticipant().add(parseActivityDefinitionParticipantComponent(xpp));
2345    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
2346      res.setProduct(parseType("product", xpp));
2347    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
2348      res.setQuantity(parseQuantity(xpp));
2349    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
2350      res.getDosage().add(parseDosage(xpp));
2351    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
2352      res.getBodySite().add(parseCodeableConcept(xpp));
2353    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimenRequirement")) {
2354      res.getSpecimenRequirement().add(parseReference(xpp));
2355    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observationRequirement")) {
2356      res.getObservationRequirement().add(parseReference(xpp));
2357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observationResultRequirement")) {
2358      res.getObservationResultRequirement().add(parseReference(xpp));
2359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
2360      res.setTransformElement(parseCanonical(xpp));
2361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
2362      res.getDynamicValue().add(parseActivityDefinitionDynamicValueComponent(xpp));
2363    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
2364      return false;
2365    }
2366    return true;
2367  }
2368
2369  protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2370    ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent();
2371    parseElementAttributes(xpp, res);
2372    next(xpp);
2373    int eventType = nextNoWhitespace(xpp);
2374    while (eventType != XmlPullParser.END_TAG) {
2375    if (!parseActivityDefinitionParticipantComponentContent(eventType, xpp, res))
2376        unknownContent(xpp);
2377      eventType = nextNoWhitespace(xpp);
2378    }
2379    next(xpp);
2380    parseElementClose(res);
2381    return res;
2382  }
2383
2384  protected boolean parseActivityDefinitionParticipantComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition.ActivityDefinitionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2385    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2386      res.setTypeElement(parseEnumeration(xpp, Enumerations.ActionParticipantType.NULL, new Enumerations.ActionParticipantTypeEnumFactory()));
2387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("typeReference")) {
2388      res.setTypeReference(parseReference(xpp));
2389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2390      res.setRole(parseCodeableConcept(xpp));
2391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
2392      res.setFunction(parseCodeableConcept(xpp));
2393    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2394      return false;
2395    }
2396    return true;
2397  }
2398
2399  protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionDynamicValueComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2400    ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent();
2401    parseElementAttributes(xpp, res);
2402    next(xpp);
2403    int eventType = nextNoWhitespace(xpp);
2404    while (eventType != XmlPullParser.END_TAG) {
2405    if (!parseActivityDefinitionDynamicValueComponentContent(eventType, xpp, res))
2406        unknownContent(xpp);
2407      eventType = nextNoWhitespace(xpp);
2408    }
2409    next(xpp);
2410    parseElementClose(res);
2411    return res;
2412  }
2413
2414  protected boolean parseActivityDefinitionDynamicValueComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2415    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
2416      res.setPathElement(parseString(xpp));
2417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
2418      res.setExpression(parseExpression(xpp));
2419    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2420      return false;
2421    }
2422    return true;
2423  }
2424
2425  protected AdministrableProductDefinition parseAdministrableProductDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2426    AdministrableProductDefinition res = new AdministrableProductDefinition();
2427    parseResourceAttributes(xpp, res);
2428    next(xpp);
2429    int eventType = nextNoWhitespace(xpp);
2430    while (eventType != XmlPullParser.END_TAG) {
2431    if (!parseAdministrableProductDefinitionContent(eventType, xpp, res))
2432        unknownContent(xpp);
2433      eventType = nextNoWhitespace(xpp);
2434    }
2435    next(xpp);
2436    parseElementClose(res);
2437    return res;
2438  }
2439
2440  protected boolean parseAdministrableProductDefinitionContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2441    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2442      res.getIdentifier().add(parseIdentifier(xpp));
2443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2444      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("formOf")) {
2446      res.getFormOf().add(parseReference(xpp));
2447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("administrableDoseForm")) {
2448      res.setAdministrableDoseForm(parseCodeableConcept(xpp));
2449    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitOfPresentation")) {
2450      res.setUnitOfPresentation(parseCodeableConcept(xpp));
2451    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("producedFrom")) {
2452      res.getProducedFrom().add(parseReference(xpp));
2453    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ingredient")) {
2454      res.getIngredient().add(parseCodeableConcept(xpp));
2455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
2456      res.setDevice(parseReference(xpp));
2457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
2458      res.getProperty().add(parseAdministrableProductDefinitionPropertyComponent(xpp));
2459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("routeOfAdministration")) {
2460      res.getRouteOfAdministration().add(parseAdministrableProductDefinitionRouteOfAdministrationComponent(xpp));
2461    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2462      return false;
2463    }
2464    return true;
2465  }
2466
2467  protected AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent parseAdministrableProductDefinitionPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2468    AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent();
2469    parseElementAttributes(xpp, res);
2470    next(xpp);
2471    int eventType = nextNoWhitespace(xpp);
2472    while (eventType != XmlPullParser.END_TAG) {
2473    if (!parseAdministrableProductDefinitionPropertyComponentContent(eventType, xpp, res))
2474        unknownContent(xpp);
2475      eventType = nextNoWhitespace(xpp);
2476    }
2477    next(xpp);
2478    parseElementClose(res);
2479    return res;
2480  }
2481
2482  protected boolean parseAdministrableProductDefinitionPropertyComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2483    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2484      res.setType(parseCodeableConcept(xpp));
2485    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
2486      res.setValue(parseType("value", xpp));
2487    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2488      res.setStatus(parseCodeableConcept(xpp));
2489    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2490      return false;
2491    }
2492    return true;
2493  }
2494
2495  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent parseAdministrableProductDefinitionRouteOfAdministrationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2496    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent();
2497    parseElementAttributes(xpp, res);
2498    next(xpp);
2499    int eventType = nextNoWhitespace(xpp);
2500    while (eventType != XmlPullParser.END_TAG) {
2501    if (!parseAdministrableProductDefinitionRouteOfAdministrationComponentContent(eventType, xpp, res))
2502        unknownContent(xpp);
2503      eventType = nextNoWhitespace(xpp);
2504    }
2505    next(xpp);
2506    parseElementClose(res);
2507    return res;
2508  }
2509
2510  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2511    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2512      res.setCode(parseCodeableConcept(xpp));
2513    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("firstDose")) {
2514      res.setFirstDose(parseQuantity(xpp));
2515    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxSingleDose")) {
2516      res.setMaxSingleDose(parseQuantity(xpp));
2517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerDay")) {
2518      res.setMaxDosePerDay(parseQuantity(xpp));
2519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerTreatmentPeriod")) {
2520      res.setMaxDosePerTreatmentPeriod(parseRatio(xpp));
2521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxTreatmentPeriod")) {
2522      res.setMaxTreatmentPeriod(parseDuration(xpp));
2523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetSpecies")) {
2524      res.getTargetSpecies().add(parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(xpp));
2525    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2526      return false;
2527    }
2528    return true;
2529  }
2530
2531  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2532    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent();
2533    parseElementAttributes(xpp, res);
2534    next(xpp);
2535    int eventType = nextNoWhitespace(xpp);
2536    while (eventType != XmlPullParser.END_TAG) {
2537    if (!parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponentContent(eventType, xpp, res))
2538        unknownContent(xpp);
2539      eventType = nextNoWhitespace(xpp);
2540    }
2541    next(xpp);
2542    parseElementClose(res);
2543    return res;
2544  }
2545
2546  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2547    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2548      res.setCode(parseCodeableConcept(xpp));
2549    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("withdrawalPeriod")) {
2550      res.getWithdrawalPeriod().add(parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(xpp));
2551    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2552      return false;
2553    }
2554    return true;
2555  }
2556
2557  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2558    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent();
2559    parseElementAttributes(xpp, res);
2560    next(xpp);
2561    int eventType = nextNoWhitespace(xpp);
2562    while (eventType != XmlPullParser.END_TAG) {
2563    if (!parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentContent(eventType, xpp, res))
2564        unknownContent(xpp);
2565      eventType = nextNoWhitespace(xpp);
2566    }
2567    next(xpp);
2568    parseElementClose(res);
2569    return res;
2570  }
2571
2572  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2573    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tissue")) {
2574      res.setTissue(parseCodeableConcept(xpp));
2575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
2576      res.setValue(parseQuantity(xpp));
2577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2578      res.setSupportingInformationElement(parseString(xpp));
2579    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2580      return false;
2581    }
2582    return true;
2583  }
2584
2585  protected AdverseEvent parseAdverseEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2586    AdverseEvent res = new AdverseEvent();
2587    parseResourceAttributes(xpp, res);
2588    next(xpp);
2589    int eventType = nextNoWhitespace(xpp);
2590    while (eventType != XmlPullParser.END_TAG) {
2591    if (!parseAdverseEventContent(eventType, xpp, res))
2592        unknownContent(xpp);
2593      eventType = nextNoWhitespace(xpp);
2594    }
2595    next(xpp);
2596    parseElementClose(res);
2597    return res;
2598  }
2599
2600  protected boolean parseAdverseEventContent(int eventType, XmlPullParser xpp, AdverseEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2601    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2602      res.getIdentifier().add(parseIdentifier(xpp));
2603    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2604      res.setStatusElement(parseEnumeration(xpp, AdverseEvent.AdverseEventStatus.NULL, new AdverseEvent.AdverseEventStatusEnumFactory()));
2605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actuality")) {
2606      res.setActualityElement(parseEnumeration(xpp, AdverseEvent.AdverseEventActuality.NULL, new AdverseEvent.AdverseEventActualityEnumFactory()));
2607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2608      res.getCategory().add(parseCodeableConcept(xpp));
2609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2610      res.setCode(parseCodeableConcept(xpp));
2611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2612      res.setSubject(parseReference(xpp));
2613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
2614      res.setEncounter(parseReference(xpp));
2615    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
2616      res.setOccurrence(parseType("occurrence", xpp));
2617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detected")) {
2618      res.setDetectedElement(parseDateTime(xpp));
2619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedDate")) {
2620      res.setRecordedDateElement(parseDateTime(xpp));
2621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resultingCondition")) {
2622      res.getResultingCondition().add(parseReference(xpp));
2623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2624      res.setLocation(parseReference(xpp));
2625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriousness")) {
2626      res.setSeriousness(parseCodeableConcept(xpp));
2627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2628      res.getOutcome().add(parseCodeableConcept(xpp));
2629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2630      res.setRecorder(parseReference(xpp));
2631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2632      res.getParticipant().add(parseAdverseEventParticipantComponent(xpp));
2633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suspectEntity")) {
2634      res.getSuspectEntity().add(parseAdverseEventSuspectEntityComponent(xpp));
2635    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributingFactor")) {
2636      res.getContributingFactor().add(parseAdverseEventContributingFactorComponent(xpp));
2637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preventiveAction")) {
2638      res.getPreventiveAction().add(parseAdverseEventPreventiveActionComponent(xpp));
2639    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigatingAction")) {
2640      res.getMitigatingAction().add(parseAdverseEventMitigatingActionComponent(xpp));
2641    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
2642      res.getSupportingInfo().add(parseAdverseEventSupportingInfoComponent(xpp));
2643    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
2644      res.getStudy().add(parseReference(xpp));
2645    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2646      return false;
2647    }
2648    return true;
2649  }
2650
2651  protected AdverseEvent.AdverseEventParticipantComponent parseAdverseEventParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2652    AdverseEvent.AdverseEventParticipantComponent res = new AdverseEvent.AdverseEventParticipantComponent();
2653    parseElementAttributes(xpp, res);
2654    next(xpp);
2655    int eventType = nextNoWhitespace(xpp);
2656    while (eventType != XmlPullParser.END_TAG) {
2657    if (!parseAdverseEventParticipantComponentContent(eventType, xpp, res))
2658        unknownContent(xpp);
2659      eventType = nextNoWhitespace(xpp);
2660    }
2661    next(xpp);
2662    parseElementClose(res);
2663    return res;
2664  }
2665
2666  protected boolean parseAdverseEventParticipantComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2667    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
2668      res.setFunction(parseCodeableConcept(xpp));
2669    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2670      res.setActor(parseReference(xpp));
2671    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2672      return false;
2673    }
2674    return true;
2675  }
2676
2677  protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventSuspectEntityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2678    AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent();
2679    parseElementAttributes(xpp, res);
2680    next(xpp);
2681    int eventType = nextNoWhitespace(xpp);
2682    while (eventType != XmlPullParser.END_TAG) {
2683    if (!parseAdverseEventSuspectEntityComponentContent(eventType, xpp, res))
2684        unknownContent(xpp);
2685      eventType = nextNoWhitespace(xpp);
2686    }
2687    next(xpp);
2688    parseElementClose(res);
2689    return res;
2690  }
2691
2692  protected boolean parseAdverseEventSuspectEntityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSuspectEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2693    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "instance")) {
2694      res.setInstance(parseType("instance", xpp));
2695    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causality")) {
2696      res.setCausality(parseAdverseEventSuspectEntityCausalityComponent(xpp));
2697    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2698      return false;
2699    }
2700    return true;
2701  }
2702
2703  protected AdverseEvent.AdverseEventSuspectEntityCausalityComponent parseAdverseEventSuspectEntityCausalityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2704    AdverseEvent.AdverseEventSuspectEntityCausalityComponent res = new AdverseEvent.AdverseEventSuspectEntityCausalityComponent();
2705    parseElementAttributes(xpp, res);
2706    next(xpp);
2707    int eventType = nextNoWhitespace(xpp);
2708    while (eventType != XmlPullParser.END_TAG) {
2709    if (!parseAdverseEventSuspectEntityCausalityComponentContent(eventType, xpp, res))
2710        unknownContent(xpp);
2711      eventType = nextNoWhitespace(xpp);
2712    }
2713    next(xpp);
2714    parseElementClose(res);
2715    return res;
2716  }
2717
2718  protected boolean parseAdverseEventSuspectEntityCausalityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSuspectEntityCausalityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2719    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessmentMethod")) {
2720      res.setAssessmentMethod(parseCodeableConcept(xpp));
2721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entityRelatedness")) {
2722      res.setEntityRelatedness(parseCodeableConcept(xpp));
2723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2724      res.setAuthor(parseReference(xpp));
2725    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2726      return false;
2727    }
2728    return true;
2729  }
2730
2731  protected AdverseEvent.AdverseEventContributingFactorComponent parseAdverseEventContributingFactorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2732    AdverseEvent.AdverseEventContributingFactorComponent res = new AdverseEvent.AdverseEventContributingFactorComponent();
2733    parseElementAttributes(xpp, res);
2734    next(xpp);
2735    int eventType = nextNoWhitespace(xpp);
2736    while (eventType != XmlPullParser.END_TAG) {
2737    if (!parseAdverseEventContributingFactorComponentContent(eventType, xpp, res))
2738        unknownContent(xpp);
2739      eventType = nextNoWhitespace(xpp);
2740    }
2741    next(xpp);
2742    parseElementClose(res);
2743    return res;
2744  }
2745
2746  protected boolean parseAdverseEventContributingFactorComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventContributingFactorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2747    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
2748      res.setItem(parseType("item", xpp));
2749    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2750      return false;
2751    }
2752    return true;
2753  }
2754
2755  protected AdverseEvent.AdverseEventPreventiveActionComponent parseAdverseEventPreventiveActionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2756    AdverseEvent.AdverseEventPreventiveActionComponent res = new AdverseEvent.AdverseEventPreventiveActionComponent();
2757    parseElementAttributes(xpp, res);
2758    next(xpp);
2759    int eventType = nextNoWhitespace(xpp);
2760    while (eventType != XmlPullParser.END_TAG) {
2761    if (!parseAdverseEventPreventiveActionComponentContent(eventType, xpp, res))
2762        unknownContent(xpp);
2763      eventType = nextNoWhitespace(xpp);
2764    }
2765    next(xpp);
2766    parseElementClose(res);
2767    return res;
2768  }
2769
2770  protected boolean parseAdverseEventPreventiveActionComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventPreventiveActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2771    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
2772      res.setItem(parseType("item", xpp));
2773    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2774      return false;
2775    }
2776    return true;
2777  }
2778
2779  protected AdverseEvent.AdverseEventMitigatingActionComponent parseAdverseEventMitigatingActionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2780    AdverseEvent.AdverseEventMitigatingActionComponent res = new AdverseEvent.AdverseEventMitigatingActionComponent();
2781    parseElementAttributes(xpp, res);
2782    next(xpp);
2783    int eventType = nextNoWhitespace(xpp);
2784    while (eventType != XmlPullParser.END_TAG) {
2785    if (!parseAdverseEventMitigatingActionComponentContent(eventType, xpp, res))
2786        unknownContent(xpp);
2787      eventType = nextNoWhitespace(xpp);
2788    }
2789    next(xpp);
2790    parseElementClose(res);
2791    return res;
2792  }
2793
2794  protected boolean parseAdverseEventMitigatingActionComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventMitigatingActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2795    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
2796      res.setItem(parseType("item", xpp));
2797    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2798      return false;
2799    }
2800    return true;
2801  }
2802
2803  protected AdverseEvent.AdverseEventSupportingInfoComponent parseAdverseEventSupportingInfoComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2804    AdverseEvent.AdverseEventSupportingInfoComponent res = new AdverseEvent.AdverseEventSupportingInfoComponent();
2805    parseElementAttributes(xpp, res);
2806    next(xpp);
2807    int eventType = nextNoWhitespace(xpp);
2808    while (eventType != XmlPullParser.END_TAG) {
2809    if (!parseAdverseEventSupportingInfoComponentContent(eventType, xpp, res))
2810        unknownContent(xpp);
2811      eventType = nextNoWhitespace(xpp);
2812    }
2813    next(xpp);
2814    parseElementClose(res);
2815    return res;
2816  }
2817
2818  protected boolean parseAdverseEventSupportingInfoComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSupportingInfoComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2819    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
2820      res.setItem(parseType("item", xpp));
2821    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2822      return false;
2823    }
2824    return true;
2825  }
2826
2827  protected AllergyIntolerance parseAllergyIntolerance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2828    AllergyIntolerance res = new AllergyIntolerance();
2829    parseResourceAttributes(xpp, res);
2830    next(xpp);
2831    int eventType = nextNoWhitespace(xpp);
2832    while (eventType != XmlPullParser.END_TAG) {
2833    if (!parseAllergyIntoleranceContent(eventType, xpp, res))
2834        unknownContent(xpp);
2835      eventType = nextNoWhitespace(xpp);
2836    }
2837    next(xpp);
2838    parseElementClose(res);
2839    return res;
2840  }
2841
2842  protected boolean parseAllergyIntoleranceContent(int eventType, XmlPullParser xpp, AllergyIntolerance res) throws XmlPullParserException, IOException, FHIRFormatError {
2843    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2844      res.getIdentifier().add(parseIdentifier(xpp));
2845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
2846      res.setClinicalStatus(parseCodeableConcept(xpp));
2847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
2848      res.setVerificationStatus(parseCodeableConcept(xpp));
2849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2850      res.setTypeElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceType.NULL, new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()));
2851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2852      res.getCategory().add(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCategory.NULL, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()));
2853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criticality")) {
2854      res.setCriticalityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCriticality.NULL, new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()));
2855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2856      res.setCode(parseCodeableConcept(xpp));
2857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2858      res.setPatient(parseReference(xpp));
2859    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
2860      res.setEncounter(parseReference(xpp));
2861    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
2862      res.setOnset(parseType("onset", xpp));
2863    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedDate")) {
2864      res.setRecordedDateElement(parseDateTime(xpp));
2865    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2866      res.setRecorder(parseReference(xpp));
2867    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
2868      res.setAsserter(parseReference(xpp));
2869    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrence")) {
2870      res.setLastOccurrenceElement(parseDateTime(xpp));
2871    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2872      res.getNote().add(parseAnnotation(xpp));
2873    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2874      res.getReaction().add(parseAllergyIntoleranceReactionComponent(xpp));
2875    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2876      return false;
2877    }
2878    return true;
2879  }
2880
2881  protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceReactionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2882    AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent();
2883    parseElementAttributes(xpp, res);
2884    next(xpp);
2885    int eventType = nextNoWhitespace(xpp);
2886    while (eventType != XmlPullParser.END_TAG) {
2887    if (!parseAllergyIntoleranceReactionComponentContent(eventType, xpp, res))
2888        unknownContent(xpp);
2889      eventType = nextNoWhitespace(xpp);
2890    }
2891    next(xpp);
2892    parseElementClose(res);
2893    return res;
2894  }
2895
2896  protected boolean parseAllergyIntoleranceReactionComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance.AllergyIntoleranceReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2897    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substance")) {
2898      res.setSubstance(parseCodeableConcept(xpp));
2899    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manifestation")) {
2900      res.getManifestation().add(parseCodeableReference(xpp));
2901    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2902      res.setDescriptionElement(parseString(xpp));
2903    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onset")) {
2904      res.setOnsetElement(parseDateTime(xpp));
2905    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
2906      res.setSeverityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceSeverity.NULL, new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()));
2907    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exposureRoute")) {
2908      res.setExposureRoute(parseCodeableConcept(xpp));
2909    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2910      res.getNote().add(parseAnnotation(xpp));
2911    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2912      return false;
2913    }
2914    return true;
2915  }
2916
2917  protected Appointment parseAppointment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2918    Appointment res = new Appointment();
2919    parseResourceAttributes(xpp, res);
2920    next(xpp);
2921    int eventType = nextNoWhitespace(xpp);
2922    while (eventType != XmlPullParser.END_TAG) {
2923    if (!parseAppointmentContent(eventType, xpp, res))
2924        unknownContent(xpp);
2925      eventType = nextNoWhitespace(xpp);
2926    }
2927    next(xpp);
2928    parseElementClose(res);
2929    return res;
2930  }
2931
2932  protected boolean parseAppointmentContent(int eventType, XmlPullParser xpp, Appointment res) throws XmlPullParserException, IOException, FHIRFormatError {
2933    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2934      res.getIdentifier().add(parseIdentifier(xpp));
2935    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2936      res.setStatusElement(parseEnumeration(xpp, Appointment.AppointmentStatus.NULL, new Appointment.AppointmentStatusEnumFactory()));
2937    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cancellationReason")) {
2938      res.setCancellationReason(parseCodeableConcept(xpp));
2939    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
2940      res.getServiceCategory().add(parseCodeableConcept(xpp));
2941    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
2942      res.getServiceType().add(parseCodeableConcept(xpp));
2943    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
2944      res.getSpecialty().add(parseCodeableConcept(xpp));
2945    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
2946      res.setAppointmentType(parseCodeableConcept(xpp));
2947    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
2948      res.getReason().add(parseCodeableReference(xpp));
2949    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2950      res.setPriority(parseCodeableConcept(xpp));
2951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2952      res.setDescriptionElement(parseString(xpp));
2953    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
2954      res.getReplaces().add(parseReference(xpp));
2955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2956      res.getSupportingInformation().add(parseReference(xpp));
2957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2958      res.setStartElement(parseInstant(xpp));
2959    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2960      res.setEndElement(parseInstant(xpp));
2961    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minutesDuration")) {
2962      res.setMinutesDurationElement(parsePositiveInt(xpp));
2963    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slot")) {
2964      res.getSlot().add(parseReference(xpp));
2965    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
2966      res.getAccount().add(parseReference(xpp));
2967    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2968      res.setCreatedElement(parseDateTime(xpp));
2969    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2970      res.getNote().add(parseAnnotation(xpp));
2971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
2972      res.getPatientInstruction().add(parseCodeableReference(xpp));
2973    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
2974      res.getBasedOn().add(parseReference(xpp));
2975    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2976      res.setSubject(parseReference(xpp));
2977    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2978      res.getParticipant().add(parseAppointmentParticipantComponent(xpp));
2979    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestedPeriod")) {
2980      res.getRequestedPeriod().add(parsePeriod(xpp));
2981    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2982      return false;
2983    }
2984    return true;
2985  }
2986
2987  protected Appointment.AppointmentParticipantComponent parseAppointmentParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2988    Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent();
2989    parseElementAttributes(xpp, res);
2990    next(xpp);
2991    int eventType = nextNoWhitespace(xpp);
2992    while (eventType != XmlPullParser.END_TAG) {
2993    if (!parseAppointmentParticipantComponentContent(eventType, xpp, res))
2994        unknownContent(xpp);
2995      eventType = nextNoWhitespace(xpp);
2996    }
2997    next(xpp);
2998    parseElementClose(res);
2999    return res;
3000  }
3001
3002  protected boolean parseAppointmentParticipantComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3003    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3004      res.getType().add(parseCodeableConcept(xpp));
3005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3006      res.setPeriod(parsePeriod(xpp));
3007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3008      res.setActor(parseReference(xpp));
3009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
3010      res.setRequiredElement(parseBoolean(xpp));
3011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3012      res.setStatusElement(parseEnumeration(xpp, Enumerations.ParticipationStatus.NULL, new Enumerations.ParticipationStatusEnumFactory()));
3013    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3014      return false;
3015    }
3016    return true;
3017  }
3018
3019  protected AppointmentResponse parseAppointmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3020    AppointmentResponse res = new AppointmentResponse();
3021    parseResourceAttributes(xpp, res);
3022    next(xpp);
3023    int eventType = nextNoWhitespace(xpp);
3024    while (eventType != XmlPullParser.END_TAG) {
3025    if (!parseAppointmentResponseContent(eventType, xpp, res))
3026        unknownContent(xpp);
3027      eventType = nextNoWhitespace(xpp);
3028    }
3029    next(xpp);
3030    parseElementClose(res);
3031    return res;
3032  }
3033
3034  protected boolean parseAppointmentResponseContent(int eventType, XmlPullParser xpp, AppointmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
3035    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3036      res.getIdentifier().add(parseIdentifier(xpp));
3037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
3038      res.setAppointment(parseReference(xpp));
3039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
3040      res.setStartElement(parseInstant(xpp));
3041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
3042      res.setEndElement(parseInstant(xpp));
3043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantType")) {
3044      res.getParticipantType().add(parseCodeableConcept(xpp));
3045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3046      res.setActor(parseReference(xpp));
3047    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantStatus")) {
3048      res.setParticipantStatusElement(parseEnumeration(xpp, Enumerations.ParticipationStatus.NULL, new Enumerations.ParticipationStatusEnumFactory()));
3049    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
3050      res.setCommentElement(parseString(xpp));
3051    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3052      return false;
3053    }
3054    return true;
3055  }
3056
3057  protected ArtifactAssessment parseArtifactAssessment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3058    ArtifactAssessment res = new ArtifactAssessment();
3059    parseResourceAttributes(xpp, res);
3060    next(xpp);
3061    int eventType = nextNoWhitespace(xpp);
3062    while (eventType != XmlPullParser.END_TAG) {
3063    if (!parseArtifactAssessmentContent(eventType, xpp, res))
3064        unknownContent(xpp);
3065      eventType = nextNoWhitespace(xpp);
3066    }
3067    next(xpp);
3068    parseElementClose(res);
3069    return res;
3070  }
3071
3072  protected boolean parseArtifactAssessmentContent(int eventType, XmlPullParser xpp, ArtifactAssessment res) throws XmlPullParserException, IOException, FHIRFormatError {
3073    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3074      res.getIdentifier().add(parseIdentifier(xpp));
3075    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "citeAs")) {
3076      res.setCiteAs(parseType("citeAs", xpp));
3077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3078      res.setDateElement(parseDateTime(xpp));
3079    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
3080      res.setCopyrightElement(parseMarkdown(xpp));
3081    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
3082      res.setApprovalDateElement(parseDate(xpp));
3083    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
3084      res.setLastReviewDateElement(parseDate(xpp));
3085    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "artifact")) {
3086      res.setArtifact(parseType("artifact", xpp));
3087    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
3088      res.getContent().add(parseArtifactAssessmentContentComponent(xpp));
3089    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("workflowStatus")) {
3090      res.setWorkflowStatusElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentWorkflowStatus.NULL, new ArtifactAssessment.ArtifactAssessmentWorkflowStatusEnumFactory()));
3091    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
3092      res.setDispositionElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentDisposition.NULL, new ArtifactAssessment.ArtifactAssessmentDispositionEnumFactory()));
3093    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
3094      return false;
3095    }
3096    return true;
3097  }
3098
3099  protected ArtifactAssessment.ArtifactAssessmentContentComponent parseArtifactAssessmentContentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3100    ArtifactAssessment.ArtifactAssessmentContentComponent res = new ArtifactAssessment.ArtifactAssessmentContentComponent();
3101    parseElementAttributes(xpp, res);
3102    next(xpp);
3103    int eventType = nextNoWhitespace(xpp);
3104    while (eventType != XmlPullParser.END_TAG) {
3105    if (!parseArtifactAssessmentContentComponentContent(eventType, xpp, res))
3106        unknownContent(xpp);
3107      eventType = nextNoWhitespace(xpp);
3108    }
3109    next(xpp);
3110    parseElementClose(res);
3111    return res;
3112  }
3113
3114  protected boolean parseArtifactAssessmentContentComponentContent(int eventType, XmlPullParser xpp, ArtifactAssessment.ArtifactAssessmentContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3115    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationType")) {
3116      res.setInformationTypeElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentInformationType.NULL, new ArtifactAssessment.ArtifactAssessmentInformationTypeEnumFactory()));
3117    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
3118      res.setSummaryElement(parseMarkdown(xpp));
3119    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3120      res.setType(parseCodeableConcept(xpp));
3121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
3122      res.getClassifier().add(parseCodeableConcept(xpp));
3123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3124      res.setAuthor(parseReference(xpp));
3125    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
3126      res.getPath().add(parseUri(xpp));
3127    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
3128      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
3129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("freeToShare")) {
3130      res.setFreeToShareElement(parseBoolean(xpp));
3131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("component")) {
3132      res.getComponent().add(parseArtifactAssessmentContentComponent(xpp));
3133    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3134      return false;
3135    }
3136    return true;
3137  }
3138
3139  protected AuditEvent parseAuditEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3140    AuditEvent res = new AuditEvent();
3141    parseResourceAttributes(xpp, res);
3142    next(xpp);
3143    int eventType = nextNoWhitespace(xpp);
3144    while (eventType != XmlPullParser.END_TAG) {
3145    if (!parseAuditEventContent(eventType, xpp, res))
3146        unknownContent(xpp);
3147      eventType = nextNoWhitespace(xpp);
3148    }
3149    next(xpp);
3150    parseElementClose(res);
3151    return res;
3152  }
3153
3154  protected boolean parseAuditEventContent(int eventType, XmlPullParser xpp, AuditEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
3155    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3156      res.getCategory().add(parseCodeableConcept(xpp));
3157    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3158      res.setCode(parseCodeableConcept(xpp));
3159    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
3160      res.setActionElement(parseEnumeration(xpp, AuditEvent.AuditEventAction.NULL, new AuditEvent.AuditEventActionEnumFactory()));
3161    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
3162      res.setSeverityElement(parseEnumeration(xpp, AuditEvent.AuditEventSeverity.NULL, new AuditEvent.AuditEventSeverityEnumFactory()));
3163    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurred")) {
3164      res.setOccurred(parseType("occurred", xpp));
3165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
3166      res.setRecordedElement(parseInstant(xpp));
3167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
3168      res.setOutcome(parseAuditEventOutcomeComponent(xpp));
3169    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authorization")) {
3170      res.getAuthorization().add(parseCodeableConcept(xpp));
3171    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3172      res.getBasedOn().add(parseReference(xpp));
3173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
3174      res.setEncounter(parseReference(xpp));
3175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
3176      res.getAgent().add(parseAuditEventAgentComponent(xpp));
3177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
3178      res.setSource(parseAuditEventSourceComponent(xpp));
3179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
3180      res.getEntity().add(parseAuditEventEntityComponent(xpp));
3181    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3182      return false;
3183    }
3184    return true;
3185  }
3186
3187  protected AuditEvent.AuditEventOutcomeComponent parseAuditEventOutcomeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3188    AuditEvent.AuditEventOutcomeComponent res = new AuditEvent.AuditEventOutcomeComponent();
3189    parseElementAttributes(xpp, res);
3190    next(xpp);
3191    int eventType = nextNoWhitespace(xpp);
3192    while (eventType != XmlPullParser.END_TAG) {
3193    if (!parseAuditEventOutcomeComponentContent(eventType, xpp, res))
3194        unknownContent(xpp);
3195      eventType = nextNoWhitespace(xpp);
3196    }
3197    next(xpp);
3198    parseElementClose(res);
3199    return res;
3200  }
3201
3202  protected boolean parseAuditEventOutcomeComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventOutcomeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3203    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3204      res.setCode(parseCoding(xpp));
3205    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3206      res.getDetail().add(parseCodeableConcept(xpp));
3207    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3208      return false;
3209    }
3210    return true;
3211  }
3212
3213  protected AuditEvent.AuditEventAgentComponent parseAuditEventAgentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3214    AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent();
3215    parseElementAttributes(xpp, res);
3216    next(xpp);
3217    int eventType = nextNoWhitespace(xpp);
3218    while (eventType != XmlPullParser.END_TAG) {
3219    if (!parseAuditEventAgentComponentContent(eventType, xpp, res))
3220        unknownContent(xpp);
3221      eventType = nextNoWhitespace(xpp);
3222    }
3223    next(xpp);
3224    parseElementClose(res);
3225    return res;
3226  }
3227
3228  protected boolean parseAuditEventAgentComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3229    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3230      res.setType(parseCodeableConcept(xpp));
3231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3232      res.getRole().add(parseCodeableConcept(xpp));
3233    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("who")) {
3234      res.setWho(parseReference(xpp));
3235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
3236      res.setRequestorElement(parseBoolean(xpp));
3237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3238      res.setLocation(parseReference(xpp));
3239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
3240      res.getPolicy().add(parseUri(xpp));
3241    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "network")) {
3242      res.setNetwork(parseType("network", xpp));
3243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authorization")) {
3244      res.getAuthorization().add(parseCodeableConcept(xpp));
3245    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3246      return false;
3247    }
3248    return true;
3249  }
3250
3251  protected AuditEvent.AuditEventSourceComponent parseAuditEventSourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3252    AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent();
3253    parseElementAttributes(xpp, res);
3254    next(xpp);
3255    int eventType = nextNoWhitespace(xpp);
3256    while (eventType != XmlPullParser.END_TAG) {
3257    if (!parseAuditEventSourceComponentContent(eventType, xpp, res))
3258        unknownContent(xpp);
3259      eventType = nextNoWhitespace(xpp);
3260    }
3261    next(xpp);
3262    parseElementClose(res);
3263    return res;
3264  }
3265
3266  protected boolean parseAuditEventSourceComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3267    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
3268      res.setSite(parseReference(xpp));
3269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observer")) {
3270      res.setObserver(parseReference(xpp));
3271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3272      res.getType().add(parseCodeableConcept(xpp));
3273    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3274      return false;
3275    }
3276    return true;
3277  }
3278
3279  protected AuditEvent.AuditEventEntityComponent parseAuditEventEntityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3280    AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent();
3281    parseElementAttributes(xpp, res);
3282    next(xpp);
3283    int eventType = nextNoWhitespace(xpp);
3284    while (eventType != XmlPullParser.END_TAG) {
3285    if (!parseAuditEventEntityComponentContent(eventType, xpp, res))
3286        unknownContent(xpp);
3287      eventType = nextNoWhitespace(xpp);
3288    }
3289    next(xpp);
3290    parseElementClose(res);
3291    return res;
3292  }
3293
3294  protected boolean parseAuditEventEntityComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3295    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("what")) {
3296      res.setWhat(parseReference(xpp));
3297    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3298      res.setRole(parseCodeableConcept(xpp));
3299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
3300      res.getSecurityLabel().add(parseCodeableConcept(xpp));
3301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("query")) {
3302      res.setQueryElement(parseBase64Binary(xpp));
3303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3304      res.getDetail().add(parseAuditEventEntityDetailComponent(xpp));
3305    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
3306      res.getAgent().add(parseAuditEventAgentComponent(xpp));
3307    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3308      return false;
3309    }
3310    return true;
3311  }
3312
3313  protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventEntityDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3314    AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent();
3315    parseElementAttributes(xpp, res);
3316    next(xpp);
3317    int eventType = nextNoWhitespace(xpp);
3318    while (eventType != XmlPullParser.END_TAG) {
3319    if (!parseAuditEventEntityDetailComponentContent(eventType, xpp, res))
3320        unknownContent(xpp);
3321      eventType = nextNoWhitespace(xpp);
3322    }
3323    next(xpp);
3324    parseElementClose(res);
3325    return res;
3326  }
3327
3328  protected boolean parseAuditEventEntityDetailComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventEntityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3329    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3330      res.setType(parseCodeableConcept(xpp));
3331    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3332      res.setValue(parseType("value", xpp));
3333    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3334      return false;
3335    }
3336    return true;
3337  }
3338
3339  protected Basic parseBasic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3340    Basic res = new Basic();
3341    parseResourceAttributes(xpp, res);
3342    next(xpp);
3343    int eventType = nextNoWhitespace(xpp);
3344    while (eventType != XmlPullParser.END_TAG) {
3345    if (!parseBasicContent(eventType, xpp, res))
3346        unknownContent(xpp);
3347      eventType = nextNoWhitespace(xpp);
3348    }
3349    next(xpp);
3350    parseElementClose(res);
3351    return res;
3352  }
3353
3354  protected boolean parseBasicContent(int eventType, XmlPullParser xpp, Basic res) throws XmlPullParserException, IOException, FHIRFormatError {
3355    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3356      res.getIdentifier().add(parseIdentifier(xpp));
3357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3358      res.setCode(parseCodeableConcept(xpp));
3359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3360      res.setSubject(parseReference(xpp));
3361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3362      res.setCreatedElement(parseDate(xpp));
3363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3364      res.setAuthor(parseReference(xpp));
3365    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3366      return false;
3367    }
3368    return true;
3369  }
3370
3371  protected Binary parseBinary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3372    Binary res = new Binary();
3373    parseResourceAttributes(xpp, res);
3374    next(xpp);
3375    int eventType = nextNoWhitespace(xpp);
3376    while (eventType != XmlPullParser.END_TAG) {
3377    if (!parseBinaryContent(eventType, xpp, res))
3378        unknownContent(xpp);
3379      eventType = nextNoWhitespace(xpp);
3380    }
3381    next(xpp);
3382    parseElementClose(res);
3383    return res;
3384  }
3385
3386  protected boolean parseBinaryContent(int eventType, XmlPullParser xpp, Binary res) throws XmlPullParserException, IOException, FHIRFormatError {
3387    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
3388      res.setContentTypeElement(parseCode(xpp));
3389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityContext")) {
3390      res.setSecurityContext(parseReference(xpp));
3391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
3392      res.setDataElement(parseBase64Binary(xpp));
3393    } else if (!parseResourceContent(eventType, xpp, res)){ 
3394      return false;
3395    }
3396    return true;
3397  }
3398
3399  protected BiologicallyDerivedProduct parseBiologicallyDerivedProduct(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3400    BiologicallyDerivedProduct res = new BiologicallyDerivedProduct();
3401    parseResourceAttributes(xpp, res);
3402    next(xpp);
3403    int eventType = nextNoWhitespace(xpp);
3404    while (eventType != XmlPullParser.END_TAG) {
3405    if (!parseBiologicallyDerivedProductContent(eventType, xpp, res))
3406        unknownContent(xpp);
3407      eventType = nextNoWhitespace(xpp);
3408    }
3409    next(xpp);
3410    parseElementClose(res);
3411    return res;
3412  }
3413
3414  protected boolean parseBiologicallyDerivedProductContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct res) throws XmlPullParserException, IOException, FHIRFormatError {
3415    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productCategory")) {
3416      res.setProductCategoryElement(parseEnumeration(xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductCategory.NULL, new BiologicallyDerivedProduct.BiologicallyDerivedProductCategoryEnumFactory()));
3417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productCode")) {
3418      res.setProductCode(parseCodeableConcept(xpp));
3419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
3420      res.getParent().add(parseReference(xpp));
3421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
3422      res.getRequest().add(parseReference(xpp));
3423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3424      res.getIdentifier().add(parseIdentifier(xpp));
3425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("biologicalSource")) {
3426      res.setBiologicalSource(parseIdentifier(xpp));
3427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processingFacility")) {
3428      res.getProcessingFacility().add(parseReference(xpp));
3429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("division")) {
3430      res.setDivisionElement(parseString(xpp));
3431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3432      res.setStatusElement(parseEnumeration(xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductStatus.NULL, new BiologicallyDerivedProduct.BiologicallyDerivedProductStatusEnumFactory()));
3433    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
3434      res.setExpirationDateElement(parseDateTime(xpp));
3435    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collection")) {
3436      res.setCollection(parseBiologicallyDerivedProductCollectionComponent(xpp));
3437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("storageTempRequirements")) {
3438      res.setStorageTempRequirements(parseRange(xpp));
3439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
3440      res.getProperty().add(parseBiologicallyDerivedProductPropertyComponent(xpp));
3441    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3442      return false;
3443    }
3444    return true;
3445  }
3446
3447  protected BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent parseBiologicallyDerivedProductCollectionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3448    BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent();
3449    parseElementAttributes(xpp, res);
3450    next(xpp);
3451    int eventType = nextNoWhitespace(xpp);
3452    while (eventType != XmlPullParser.END_TAG) {
3453    if (!parseBiologicallyDerivedProductCollectionComponentContent(eventType, xpp, res))
3454        unknownContent(xpp);
3455      eventType = nextNoWhitespace(xpp);
3456    }
3457    next(xpp);
3458    parseElementClose(res);
3459    return res;
3460  }
3461
3462  protected boolean parseBiologicallyDerivedProductCollectionComponentContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3463    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collector")) {
3464      res.setCollector(parseReference(xpp));
3465    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
3466      res.setSource(parseReference(xpp));
3467    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "collected")) {
3468      res.setCollected(parseType("collected", xpp));
3469    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3470      return false;
3471    }
3472    return true;
3473  }
3474
3475  protected BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent parseBiologicallyDerivedProductPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3476    BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent();
3477    parseElementAttributes(xpp, res);
3478    next(xpp);
3479    int eventType = nextNoWhitespace(xpp);
3480    while (eventType != XmlPullParser.END_TAG) {
3481    if (!parseBiologicallyDerivedProductPropertyComponentContent(eventType, xpp, res))
3482        unknownContent(xpp);
3483      eventType = nextNoWhitespace(xpp);
3484    }
3485    next(xpp);
3486    parseElementClose(res);
3487    return res;
3488  }
3489
3490  protected boolean parseBiologicallyDerivedProductPropertyComponentContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3491    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3492      res.setType(parseCodeableConcept(xpp));
3493    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3494      res.setValue(parseType("value", xpp));
3495    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3496      return false;
3497    }
3498    return true;
3499  }
3500
3501  protected BodyStructure parseBodyStructure(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3502    BodyStructure res = new BodyStructure();
3503    parseResourceAttributes(xpp, res);
3504    next(xpp);
3505    int eventType = nextNoWhitespace(xpp);
3506    while (eventType != XmlPullParser.END_TAG) {
3507    if (!parseBodyStructureContent(eventType, xpp, res))
3508        unknownContent(xpp);
3509      eventType = nextNoWhitespace(xpp);
3510    }
3511    next(xpp);
3512    parseElementClose(res);
3513    return res;
3514  }
3515
3516  protected boolean parseBodyStructureContent(int eventType, XmlPullParser xpp, BodyStructure res) throws XmlPullParserException, IOException, FHIRFormatError {
3517    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3518      res.getIdentifier().add(parseIdentifier(xpp));
3519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
3520      res.setActiveElement(parseBoolean(xpp));
3521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("morphology")) {
3522      res.setMorphology(parseCodeableConcept(xpp));
3523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3524      res.setLocation(parseCodeableConcept(xpp));
3525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includedStructure")) {
3526      res.getIncludedStructure().add(parseBodyStructureIncludedStructureComponent(xpp));
3527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludedStructure")) {
3528      res.getExcludedStructure().add(parseBodyStructureExcludedStructureComponent(xpp));
3529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3530      res.setDescriptionElement(parseString(xpp));
3531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
3532      res.getImage().add(parseAttachment(xpp));
3533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3534      res.setPatient(parseReference(xpp));
3535    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3536      return false;
3537    }
3538    return true;
3539  }
3540
3541  protected BodyStructure.BodyStructureIncludedStructureComponent parseBodyStructureIncludedStructureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3542    BodyStructure.BodyStructureIncludedStructureComponent res = new BodyStructure.BodyStructureIncludedStructureComponent();
3543    parseElementAttributes(xpp, res);
3544    next(xpp);
3545    int eventType = nextNoWhitespace(xpp);
3546    while (eventType != XmlPullParser.END_TAG) {
3547    if (!parseBodyStructureIncludedStructureComponentContent(eventType, xpp, res))
3548        unknownContent(xpp);
3549      eventType = nextNoWhitespace(xpp);
3550    }
3551    next(xpp);
3552    parseElementClose(res);
3553    return res;
3554  }
3555
3556  protected boolean parseBodyStructureIncludedStructureComponentContent(int eventType, XmlPullParser xpp, BodyStructure.BodyStructureIncludedStructureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3557    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("structure")) {
3558      res.setStructure(parseCodeableConcept(xpp));
3559    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("laterality")) {
3560      res.setLaterality(parseCodeableConcept(xpp));
3561    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
3562      res.getQualifier().add(parseCodeableConcept(xpp));
3563    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3564      return false;
3565    }
3566    return true;
3567  }
3568
3569  protected BodyStructure.BodyStructureExcludedStructureComponent parseBodyStructureExcludedStructureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3570    BodyStructure.BodyStructureExcludedStructureComponent res = new BodyStructure.BodyStructureExcludedStructureComponent();
3571    parseElementAttributes(xpp, res);
3572    next(xpp);
3573    int eventType = nextNoWhitespace(xpp);
3574    while (eventType != XmlPullParser.END_TAG) {
3575    if (!parseBodyStructureExcludedStructureComponentContent(eventType, xpp, res))
3576        unknownContent(xpp);
3577      eventType = nextNoWhitespace(xpp);
3578    }
3579    next(xpp);
3580    parseElementClose(res);
3581    return res;
3582  }
3583
3584  protected boolean parseBodyStructureExcludedStructureComponentContent(int eventType, XmlPullParser xpp, BodyStructure.BodyStructureExcludedStructureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3585    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("structure")) {
3586      res.setStructure(parseCodeableConcept(xpp));
3587    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("laterality")) {
3588      res.setLaterality(parseCodeableConcept(xpp));
3589    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
3590      res.getQualifier().add(parseCodeableConcept(xpp));
3591    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3592      return false;
3593    }
3594    return true;
3595  }
3596
3597  protected Bundle parseBundle(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3598    Bundle res = new Bundle();
3599    parseResourceAttributes(xpp, res);
3600    next(xpp);
3601    int eventType = nextNoWhitespace(xpp);
3602    while (eventType != XmlPullParser.END_TAG) {
3603    if (!parseBundleContent(eventType, xpp, res))
3604        unknownContent(xpp);
3605      eventType = nextNoWhitespace(xpp);
3606    }
3607    next(xpp);
3608    parseElementClose(res);
3609    return res;
3610  }
3611
3612  protected boolean parseBundleContent(int eventType, XmlPullParser xpp, Bundle res) throws XmlPullParserException, IOException, FHIRFormatError {
3613    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3614      res.setIdentifier(parseIdentifier(xpp));
3615    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3616      res.setTypeElement(parseEnumeration(xpp, Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory()));
3617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timestamp")) {
3618      res.setTimestampElement(parseInstant(xpp));
3619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
3620      res.setTotalElement(parseUnsignedInt(xpp));
3621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
3622      res.getLink().add(parseBundleLinkComponent(xpp));
3623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
3624      res.getEntry().add(parseBundleEntryComponent(xpp));
3625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
3626      res.setSignature(parseSignature(xpp));
3627    } else if (!parseResourceContent(eventType, xpp, res)){ 
3628      return false;
3629    }
3630    return true;
3631  }
3632
3633  protected Bundle.BundleLinkComponent parseBundleLinkComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3634    Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent();
3635    parseElementAttributes(xpp, res);
3636    next(xpp);
3637    int eventType = nextNoWhitespace(xpp);
3638    while (eventType != XmlPullParser.END_TAG) {
3639    if (!parseBundleLinkComponentContent(eventType, xpp, res))
3640        unknownContent(xpp);
3641      eventType = nextNoWhitespace(xpp);
3642    }
3643    next(xpp);
3644    parseElementClose(res);
3645    return res;
3646  }
3647
3648  protected boolean parseBundleLinkComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3649    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relation")) {
3650      res.setRelationElement(parseString(xpp));
3651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
3652      res.setUrlElement(parseUri(xpp));
3653    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3654      return false;
3655    }
3656    return true;
3657  }
3658
3659  protected Bundle.BundleEntryComponent parseBundleEntryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3660    Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent();
3661    parseElementAttributes(xpp, res);
3662    next(xpp);
3663    int eventType = nextNoWhitespace(xpp);
3664    while (eventType != XmlPullParser.END_TAG) {
3665    if (!parseBundleEntryComponentContent(eventType, xpp, res))
3666        unknownContent(xpp);
3667      eventType = nextNoWhitespace(xpp);
3668    }
3669    next(xpp);
3670    parseElementClose(res);
3671    return res;
3672  }
3673
3674  protected boolean parseBundleEntryComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3675    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
3676      res.getLink().add(parseBundleLinkComponent(xpp));
3677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fullUrl")) {
3678      res.setFullUrlElement(parseUri(xpp));
3679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
3680      res.setResource(parseResourceContained(xpp));
3681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
3682      res.setSearch(parseBundleEntrySearchComponent(xpp));
3683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
3684      res.setRequest(parseBundleEntryRequestComponent(xpp));
3685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
3686      res.setResponse(parseBundleEntryResponseComponent(xpp));
3687    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3688      return false;
3689    }
3690    return true;
3691  }
3692
3693  protected Bundle.BundleEntrySearchComponent parseBundleEntrySearchComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3694    Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent();
3695    parseElementAttributes(xpp, res);
3696    next(xpp);
3697    int eventType = nextNoWhitespace(xpp);
3698    while (eventType != XmlPullParser.END_TAG) {
3699    if (!parseBundleEntrySearchComponentContent(eventType, xpp, res))
3700        unknownContent(xpp);
3701      eventType = nextNoWhitespace(xpp);
3702    }
3703    next(xpp);
3704    parseElementClose(res);
3705    return res;
3706  }
3707
3708  protected boolean parseBundleEntrySearchComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntrySearchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3709    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3710      res.setModeElement(parseEnumeration(xpp, Bundle.SearchEntryMode.NULL, new Bundle.SearchEntryModeEnumFactory()));
3711    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
3712      res.setScoreElement(parseDecimal(xpp));
3713    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3714      return false;
3715    }
3716    return true;
3717  }
3718
3719  protected Bundle.BundleEntryRequestComponent parseBundleEntryRequestComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3720    Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent();
3721    parseElementAttributes(xpp, res);
3722    next(xpp);
3723    int eventType = nextNoWhitespace(xpp);
3724    while (eventType != XmlPullParser.END_TAG) {
3725    if (!parseBundleEntryRequestComponentContent(eventType, xpp, res))
3726        unknownContent(xpp);
3727      eventType = nextNoWhitespace(xpp);
3728    }
3729    next(xpp);
3730    parseElementClose(res);
3731    return res;
3732  }
3733
3734  protected boolean parseBundleEntryRequestComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3735    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
3736      res.setMethodElement(parseEnumeration(xpp, Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory()));
3737    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
3738      res.setUrlElement(parseUri(xpp));
3739    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneMatch")) {
3740      res.setIfNoneMatchElement(parseString(xpp));
3741    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifModifiedSince")) {
3742      res.setIfModifiedSinceElement(parseInstant(xpp));
3743    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifMatch")) {
3744      res.setIfMatchElement(parseString(xpp));
3745    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneExist")) {
3746      res.setIfNoneExistElement(parseString(xpp));
3747    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3748      return false;
3749    }
3750    return true;
3751  }
3752
3753  protected Bundle.BundleEntryResponseComponent parseBundleEntryResponseComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3754    Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent();
3755    parseElementAttributes(xpp, res);
3756    next(xpp);
3757    int eventType = nextNoWhitespace(xpp);
3758    while (eventType != XmlPullParser.END_TAG) {
3759    if (!parseBundleEntryResponseComponentContent(eventType, xpp, res))
3760        unknownContent(xpp);
3761      eventType = nextNoWhitespace(xpp);
3762    }
3763    next(xpp);
3764    parseElementClose(res);
3765    return res;
3766  }
3767
3768  protected boolean parseBundleEntryResponseComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3769    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3770      res.setStatusElement(parseString(xpp));
3771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3772      res.setLocationElement(parseUri(xpp));
3773    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("etag")) {
3774      res.setEtagElement(parseString(xpp));
3775    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
3776      res.setLastModifiedElement(parseInstant(xpp));
3777    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
3778      res.setOutcome(parseResourceContained(xpp));
3779    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3780      return false;
3781    }
3782    return true;
3783  }
3784
3785  protected CapabilityStatement parseCapabilityStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3786    CapabilityStatement res = new CapabilityStatement();
3787    parseResourceAttributes(xpp, res);
3788    next(xpp);
3789    int eventType = nextNoWhitespace(xpp);
3790    while (eventType != XmlPullParser.END_TAG) {
3791    if (!parseCapabilityStatementContent(eventType, xpp, res))
3792        unknownContent(xpp);
3793      eventType = nextNoWhitespace(xpp);
3794    }
3795    next(xpp);
3796    parseElementClose(res);
3797    return res;
3798  }
3799
3800  protected boolean parseCapabilityStatementContent(int eventType, XmlPullParser xpp, CapabilityStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
3801    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
3802      res.setUrlElement(parseUri(xpp));
3803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
3804      res.setVersionElement(parseString(xpp));
3805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3806      res.setNameElement(parseString(xpp));
3807    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
3808      res.setTitleElement(parseString(xpp));
3809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3810      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
3811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
3812      res.setExperimentalElement(parseBoolean(xpp));
3813    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3814      res.setDateElement(parseDateTime(xpp));
3815    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
3816      res.setPublisherElement(parseString(xpp));
3817    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
3818      res.getContact().add(parseContactDetail(xpp));
3819    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3820      res.setDescriptionElement(parseMarkdown(xpp));
3821    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
3822      res.getUseContext().add(parseUsageContext(xpp));
3823    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
3824      res.getJurisdiction().add(parseCodeableConcept(xpp));
3825    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
3826      res.setPurposeElement(parseMarkdown(xpp));
3827    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
3828      res.setCopyrightElement(parseMarkdown(xpp));
3829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
3830      res.setKindElement(parseEnumeration(xpp, Enumerations.CapabilityStatementKind.NULL, new Enumerations.CapabilityStatementKindEnumFactory()));
3831    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
3832      res.getInstantiates().add(parseCanonical(xpp));
3833    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imports")) {
3834      res.getImports().add(parseCanonical(xpp));
3835    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
3836      res.setSoftware(parseCapabilityStatementSoftwareComponent(xpp));
3837    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
3838      res.setImplementation(parseCapabilityStatementImplementationComponent(xpp));
3839    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
3840      res.setFhirVersionElement(parseEnumeration(xpp, Enumerations.FHIRVersion.NULL, new Enumerations.FHIRVersionEnumFactory()));
3841    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
3842      res.getFormat().add(parseCode(xpp));
3843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
3844      res.getPatchFormat().add(parseCode(xpp));
3845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
3846      res.getImplementationGuide().add(parseCanonical(xpp));
3847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
3848      res.getRest().add(parseCapabilityStatementRestComponent(xpp));
3849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("messaging")) {
3850      res.getMessaging().add(parseCapabilityStatementMessagingComponent(xpp));
3851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
3852      res.getDocument().add(parseCapabilityStatementDocumentComponent(xpp));
3853    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
3854      return false;
3855    }
3856    return true;
3857  }
3858
3859  protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementSoftwareComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3860    CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent();
3861    parseElementAttributes(xpp, res);
3862    next(xpp);
3863    int eventType = nextNoWhitespace(xpp);
3864    while (eventType != XmlPullParser.END_TAG) {
3865    if (!parseCapabilityStatementSoftwareComponentContent(eventType, xpp, res))
3866        unknownContent(xpp);
3867      eventType = nextNoWhitespace(xpp);
3868    }
3869    next(xpp);
3870    parseElementClose(res);
3871    return res;
3872  }
3873
3874  protected boolean parseCapabilityStatementSoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementSoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3875    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3876      res.setNameElement(parseString(xpp));
3877    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
3878      res.setVersionElement(parseString(xpp));
3879    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
3880      res.setReleaseDateElement(parseDateTime(xpp));
3881    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3882      return false;
3883    }
3884    return true;
3885  }
3886
3887  protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementImplementationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3888    CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent();
3889    parseElementAttributes(xpp, res);
3890    next(xpp);
3891    int eventType = nextNoWhitespace(xpp);
3892    while (eventType != XmlPullParser.END_TAG) {
3893    if (!parseCapabilityStatementImplementationComponentContent(eventType, xpp, res))
3894        unknownContent(xpp);
3895      eventType = nextNoWhitespace(xpp);
3896    }
3897    next(xpp);
3898    parseElementClose(res);
3899    return res;
3900  }
3901
3902  protected boolean parseCapabilityStatementImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3903    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3904      res.setDescriptionElement(parseString(xpp));
3905    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
3906      res.setUrlElement(parseUrl(xpp));
3907    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
3908      res.setCustodian(parseReference(xpp));
3909    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3910      return false;
3911    }
3912    return true;
3913  }
3914
3915  protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementRestComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3916    CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent();
3917    parseElementAttributes(xpp, res);
3918    next(xpp);
3919    int eventType = nextNoWhitespace(xpp);
3920    while (eventType != XmlPullParser.END_TAG) {
3921    if (!parseCapabilityStatementRestComponentContent(eventType, xpp, res))
3922        unknownContent(xpp);
3923      eventType = nextNoWhitespace(xpp);
3924    }
3925    next(xpp);
3926    parseElementClose(res);
3927    return res;
3928  }
3929
3930  protected boolean parseCapabilityStatementRestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3931    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3932      res.setModeElement(parseEnumeration(xpp, Enumerations.RestfulCapabilityMode.NULL, new Enumerations.RestfulCapabilityModeEnumFactory()));
3933    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3934      res.setDocumentationElement(parseMarkdown(xpp));
3935    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
3936      res.setSecurity(parseCapabilityStatementRestSecurityComponent(xpp));
3937    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
3938      res.getResource().add(parseCapabilityStatementRestResourceComponent(xpp));
3939    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
3940      res.getInteraction().add(parseCapabilityStatementSystemInteractionComponent(xpp));
3941    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
3942      res.getSearchParam().add(parseCapabilityStatementRestResourceSearchParamComponent(xpp));
3943    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
3944      res.getOperation().add(parseCapabilityStatementRestResourceOperationComponent(xpp));
3945    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
3946      res.getCompartment().add(parseCanonical(xpp));
3947    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3948      return false;
3949    }
3950    return true;
3951  }
3952
3953  protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementRestSecurityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3954    CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent();
3955    parseElementAttributes(xpp, res);
3956    next(xpp);
3957    int eventType = nextNoWhitespace(xpp);
3958    while (eventType != XmlPullParser.END_TAG) {
3959    if (!parseCapabilityStatementRestSecurityComponentContent(eventType, xpp, res))
3960        unknownContent(xpp);
3961      eventType = nextNoWhitespace(xpp);
3962    }
3963    next(xpp);
3964    parseElementClose(res);
3965    return res;
3966  }
3967
3968  protected boolean parseCapabilityStatementRestSecurityComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestSecurityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3969    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cors")) {
3970      res.setCorsElement(parseBoolean(xpp));
3971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3972      res.getService().add(parseCodeableConcept(xpp));
3973    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3974      res.setDescriptionElement(parseMarkdown(xpp));
3975    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3976      return false;
3977    }
3978    return true;
3979  }
3980
3981  protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementRestResourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3982    CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent();
3983    parseElementAttributes(xpp, res);
3984    next(xpp);
3985    int eventType = nextNoWhitespace(xpp);
3986    while (eventType != XmlPullParser.END_TAG) {
3987    if (!parseCapabilityStatementRestResourceComponentContent(eventType, xpp, res))
3988        unknownContent(xpp);
3989      eventType = nextNoWhitespace(xpp);
3990    }
3991    next(xpp);
3992    parseElementClose(res);
3993    return res;
3994  }
3995
3996  protected boolean parseCapabilityStatementRestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3997    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3998      res.setTypeElement(parseCode(xpp));
3999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
4000      res.setProfileElement(parseCanonical(xpp));
4001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedProfile")) {
4002      res.getSupportedProfile().add(parseCanonical(xpp));
4003    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4004      res.setDocumentationElement(parseMarkdown(xpp));
4005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
4006      res.getInteraction().add(parseCapabilityStatementResourceInteractionComponent(xpp));
4007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
4008      res.setVersioningElement(parseEnumeration(xpp, CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory()));
4009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readHistory")) {
4010      res.setReadHistoryElement(parseBoolean(xpp));
4011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("updateCreate")) {
4012      res.setUpdateCreateElement(parseBoolean(xpp));
4013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalCreate")) {
4014      res.setConditionalCreateElement(parseBoolean(xpp));
4015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalRead")) {
4016      res.setConditionalReadElement(parseEnumeration(xpp, CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory()));
4017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalUpdate")) {
4018      res.setConditionalUpdateElement(parseBoolean(xpp));
4019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalDelete")) {
4020      res.setConditionalDeleteElement(parseEnumeration(xpp, CapabilityStatement.ConditionalDeleteStatus.NULL, new CapabilityStatement.ConditionalDeleteStatusEnumFactory()));
4021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referencePolicy")) {
4022      res.getReferencePolicy().add(parseEnumeration(xpp, CapabilityStatement.ReferenceHandlingPolicy.NULL, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()));
4023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchInclude")) {
4024      res.getSearchInclude().add(parseString(xpp));
4025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchRevInclude")) {
4026      res.getSearchRevInclude().add(parseString(xpp));
4027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
4028      res.getSearchParam().add(parseCapabilityStatementRestResourceSearchParamComponent(xpp));
4029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
4030      res.getOperation().add(parseCapabilityStatementRestResourceOperationComponent(xpp));
4031    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4032      return false;
4033    }
4034    return true;
4035  }
4036
4037  protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4038    CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent();
4039    parseElementAttributes(xpp, res);
4040    next(xpp);
4041    int eventType = nextNoWhitespace(xpp);
4042    while (eventType != XmlPullParser.END_TAG) {
4043    if (!parseCapabilityStatementResourceInteractionComponentContent(eventType, xpp, res))
4044        unknownContent(xpp);
4045      eventType = nextNoWhitespace(xpp);
4046    }
4047    next(xpp);
4048    parseElementClose(res);
4049    return res;
4050  }
4051
4052  protected boolean parseCapabilityStatementResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4053    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4054      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.TypeRestfulInteraction.NULL, new CapabilityStatement.TypeRestfulInteractionEnumFactory()));
4055    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4056      res.setDocumentationElement(parseMarkdown(xpp));
4057    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4058      return false;
4059    }
4060    return true;
4061  }
4062
4063  protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementRestResourceSearchParamComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4064    CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
4065    parseElementAttributes(xpp, res);
4066    next(xpp);
4067    int eventType = nextNoWhitespace(xpp);
4068    while (eventType != XmlPullParser.END_TAG) {
4069    if (!parseCapabilityStatementRestResourceSearchParamComponentContent(eventType, xpp, res))
4070        unknownContent(xpp);
4071      eventType = nextNoWhitespace(xpp);
4072    }
4073    next(xpp);
4074    parseElementClose(res);
4075    return res;
4076  }
4077
4078  protected boolean parseCapabilityStatementRestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4079    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4080      res.setNameElement(parseString(xpp));
4081    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4082      res.setDefinitionElement(parseCanonical(xpp));
4083    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4084      res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
4085    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4086      res.setDocumentationElement(parseMarkdown(xpp));
4087    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4088      return false;
4089    }
4090    return true;
4091  }
4092
4093  protected CapabilityStatement.CapabilityStatementRestResourceOperationComponent parseCapabilityStatementRestResourceOperationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4094    CapabilityStatement.CapabilityStatementRestResourceOperationComponent res = new CapabilityStatement.CapabilityStatementRestResourceOperationComponent();
4095    parseElementAttributes(xpp, res);
4096    next(xpp);
4097    int eventType = nextNoWhitespace(xpp);
4098    while (eventType != XmlPullParser.END_TAG) {
4099    if (!parseCapabilityStatementRestResourceOperationComponentContent(eventType, xpp, res))
4100        unknownContent(xpp);
4101      eventType = nextNoWhitespace(xpp);
4102    }
4103    next(xpp);
4104    parseElementClose(res);
4105    return res;
4106  }
4107
4108  protected boolean parseCapabilityStatementRestResourceOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4109    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4110      res.setNameElement(parseString(xpp));
4111    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4112      res.setDefinitionElement(parseCanonical(xpp));
4113    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4114      res.setDocumentationElement(parseMarkdown(xpp));
4115    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4116      return false;
4117    }
4118    return true;
4119  }
4120
4121  protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4122    CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent();
4123    parseElementAttributes(xpp, res);
4124    next(xpp);
4125    int eventType = nextNoWhitespace(xpp);
4126    while (eventType != XmlPullParser.END_TAG) {
4127    if (!parseCapabilityStatementSystemInteractionComponentContent(eventType, xpp, res))
4128        unknownContent(xpp);
4129      eventType = nextNoWhitespace(xpp);
4130    }
4131    next(xpp);
4132    parseElementClose(res);
4133    return res;
4134  }
4135
4136  protected boolean parseCapabilityStatementSystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4137    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4138      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.SystemRestfulInteraction.NULL, new CapabilityStatement.SystemRestfulInteractionEnumFactory()));
4139    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4140      res.setDocumentationElement(parseMarkdown(xpp));
4141    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4142      return false;
4143    }
4144    return true;
4145  }
4146
4147  protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementMessagingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4148    CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent();
4149    parseElementAttributes(xpp, res);
4150    next(xpp);
4151    int eventType = nextNoWhitespace(xpp);
4152    while (eventType != XmlPullParser.END_TAG) {
4153    if (!parseCapabilityStatementMessagingComponentContent(eventType, xpp, res))
4154        unknownContent(xpp);
4155      eventType = nextNoWhitespace(xpp);
4156    }
4157    next(xpp);
4158    parseElementClose(res);
4159    return res;
4160  }
4161
4162  protected boolean parseCapabilityStatementMessagingComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4163    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
4164      res.getEndpoint().add(parseCapabilityStatementMessagingEndpointComponent(xpp));
4165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reliableCache")) {
4166      res.setReliableCacheElement(parseUnsignedInt(xpp));
4167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4168      res.setDocumentationElement(parseMarkdown(xpp));
4169    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedMessage")) {
4170      res.getSupportedMessage().add(parseCapabilityStatementMessagingSupportedMessageComponent(xpp));
4171    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4172      return false;
4173    }
4174    return true;
4175  }
4176
4177  protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementMessagingEndpointComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4178    CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
4179    parseElementAttributes(xpp, res);
4180    next(xpp);
4181    int eventType = nextNoWhitespace(xpp);
4182    while (eventType != XmlPullParser.END_TAG) {
4183    if (!parseCapabilityStatementMessagingEndpointComponentContent(eventType, xpp, res))
4184        unknownContent(xpp);
4185      eventType = nextNoWhitespace(xpp);
4186    }
4187    next(xpp);
4188    parseElementClose(res);
4189    return res;
4190  }
4191
4192  protected boolean parseCapabilityStatementMessagingEndpointComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4193    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
4194      res.setProtocol(parseCoding(xpp));
4195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
4196      res.setAddressElement(parseUrl(xpp));
4197    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4198      return false;
4199    }
4200    return true;
4201  }
4202
4203  protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementMessagingSupportedMessageComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4204    CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
4205    parseElementAttributes(xpp, res);
4206    next(xpp);
4207    int eventType = nextNoWhitespace(xpp);
4208    while (eventType != XmlPullParser.END_TAG) {
4209    if (!parseCapabilityStatementMessagingSupportedMessageComponentContent(eventType, xpp, res))
4210        unknownContent(xpp);
4211      eventType = nextNoWhitespace(xpp);
4212    }
4213    next(xpp);
4214    parseElementClose(res);
4215    return res;
4216  }
4217
4218  protected boolean parseCapabilityStatementMessagingSupportedMessageComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4219    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4220      res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
4221    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4222      res.setDefinitionElement(parseCanonical(xpp));
4223    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4224      return false;
4225    }
4226    return true;
4227  }
4228
4229  protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementDocumentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4230    CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent();
4231    parseElementAttributes(xpp, res);
4232    next(xpp);
4233    int eventType = nextNoWhitespace(xpp);
4234    while (eventType != XmlPullParser.END_TAG) {
4235    if (!parseCapabilityStatementDocumentComponentContent(eventType, xpp, res))
4236        unknownContent(xpp);
4237      eventType = nextNoWhitespace(xpp);
4238    }
4239    next(xpp);
4240    parseElementClose(res);
4241    return res;
4242  }
4243
4244  protected boolean parseCapabilityStatementDocumentComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementDocumentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4245    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4246      res.setModeElement(parseEnumeration(xpp, CapabilityStatement.DocumentMode.NULL, new CapabilityStatement.DocumentModeEnumFactory()));
4247    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4248      res.setDocumentationElement(parseMarkdown(xpp));
4249    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
4250      res.setProfileElement(parseCanonical(xpp));
4251    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4252      return false;
4253    }
4254    return true;
4255  }
4256
4257  protected CapabilityStatement2 parseCapabilityStatement2(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4258    CapabilityStatement2 res = new CapabilityStatement2();
4259    parseResourceAttributes(xpp, res);
4260    next(xpp);
4261    int eventType = nextNoWhitespace(xpp);
4262    while (eventType != XmlPullParser.END_TAG) {
4263    if (!parseCapabilityStatement2Content(eventType, xpp, res))
4264        unknownContent(xpp);
4265      eventType = nextNoWhitespace(xpp);
4266    }
4267    next(xpp);
4268    parseElementClose(res);
4269    return res;
4270  }
4271
4272  protected boolean parseCapabilityStatement2Content(int eventType, XmlPullParser xpp, CapabilityStatement2 res) throws XmlPullParserException, IOException, FHIRFormatError {
4273    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4274      res.setUrlElement(parseUri(xpp));
4275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4276      res.setVersionElement(parseString(xpp));
4277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4278      res.setNameElement(parseString(xpp));
4279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4280      res.setTitleElement(parseString(xpp));
4281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4282      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4284      res.setExperimentalElement(parseBoolean(xpp));
4285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4286      res.setDateElement(parseDateTime(xpp));
4287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4288      res.setPublisherElement(parseString(xpp));
4289    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4290      res.getContact().add(parseContactDetail(xpp));
4291    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4292      res.setDescriptionElement(parseMarkdown(xpp));
4293    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4294      res.getUseContext().add(parseUsageContext(xpp));
4295    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4296      res.getJurisdiction().add(parseCodeableConcept(xpp));
4297    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
4298      res.setPurposeElement(parseMarkdown(xpp));
4299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4300      res.setCopyrightElement(parseMarkdown(xpp));
4301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
4302      res.setKindElement(parseEnumeration(xpp, Enumerations.CapabilityStatementKind.NULL, new Enumerations.CapabilityStatementKindEnumFactory()));
4303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
4304      res.getInstantiates().add(parseCanonical(xpp));
4305    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imports")) {
4306      res.getImports().add(parseCanonical(xpp));
4307    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
4308      res.setSoftware(parseCapabilityStatement2SoftwareComponent(xpp));
4309    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
4310      res.setImplementation(parseCapabilityStatement2ImplementationComponent(xpp));
4311    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
4312      res.setFhirVersionElement(parseEnumeration(xpp, Enumerations.FHIRVersion.NULL, new Enumerations.FHIRVersionEnumFactory()));
4313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
4314      res.getFormat().add(parseCode(xpp));
4315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
4316      res.getPatchFormat().add(parseCode(xpp));
4317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
4318      res.getImplementationGuide().add(parseCanonical(xpp));
4319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
4320      res.getRest().add(parseCapabilityStatement2RestComponent(xpp));
4321    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
4322      return false;
4323    }
4324    return true;
4325  }
4326
4327  protected CapabilityStatement2.CapabilityStatement2SoftwareComponent parseCapabilityStatement2SoftwareComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4328    CapabilityStatement2.CapabilityStatement2SoftwareComponent res = new CapabilityStatement2.CapabilityStatement2SoftwareComponent();
4329    parseElementAttributes(xpp, res);
4330    next(xpp);
4331    int eventType = nextNoWhitespace(xpp);
4332    while (eventType != XmlPullParser.END_TAG) {
4333    if (!parseCapabilityStatement2SoftwareComponentContent(eventType, xpp, res))
4334        unknownContent(xpp);
4335      eventType = nextNoWhitespace(xpp);
4336    }
4337    next(xpp);
4338    parseElementClose(res);
4339    return res;
4340  }
4341
4342  protected boolean parseCapabilityStatement2SoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2SoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4343    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4344      res.setNameElement(parseString(xpp));
4345    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4346      res.setVersionElement(parseString(xpp));
4347    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
4348      res.setReleaseDateElement(parseDateTime(xpp));
4349    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4350      return false;
4351    }
4352    return true;
4353  }
4354
4355  protected CapabilityStatement2.CapabilityStatement2ImplementationComponent parseCapabilityStatement2ImplementationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4356    CapabilityStatement2.CapabilityStatement2ImplementationComponent res = new CapabilityStatement2.CapabilityStatement2ImplementationComponent();
4357    parseElementAttributes(xpp, res);
4358    next(xpp);
4359    int eventType = nextNoWhitespace(xpp);
4360    while (eventType != XmlPullParser.END_TAG) {
4361    if (!parseCapabilityStatement2ImplementationComponentContent(eventType, xpp, res))
4362        unknownContent(xpp);
4363      eventType = nextNoWhitespace(xpp);
4364    }
4365    next(xpp);
4366    parseElementClose(res);
4367    return res;
4368  }
4369
4370  protected boolean parseCapabilityStatement2ImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2ImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4371    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4372      res.setDescriptionElement(parseString(xpp));
4373    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4374      res.setUrlElement(parseUrl(xpp));
4375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
4376      res.setCustodian(parseReference(xpp));
4377    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4378      return false;
4379    }
4380    return true;
4381  }
4382
4383  protected CapabilityStatement2.CapabilityStatement2RestComponent parseCapabilityStatement2RestComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4384    CapabilityStatement2.CapabilityStatement2RestComponent res = new CapabilityStatement2.CapabilityStatement2RestComponent();
4385    parseElementAttributes(xpp, res);
4386    next(xpp);
4387    int eventType = nextNoWhitespace(xpp);
4388    while (eventType != XmlPullParser.END_TAG) {
4389    if (!parseCapabilityStatement2RestComponentContent(eventType, xpp, res))
4390        unknownContent(xpp);
4391      eventType = nextNoWhitespace(xpp);
4392    }
4393    next(xpp);
4394    parseElementClose(res);
4395    return res;
4396  }
4397
4398  protected boolean parseCapabilityStatement2RestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2RestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4399    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4400      res.setModeElement(parseEnumeration(xpp, Enumerations.RestfulCapabilityMode.NULL, new Enumerations.RestfulCapabilityModeEnumFactory()));
4401    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4402      res.setDocumentationElement(parseMarkdown(xpp));
4403    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4404      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4405    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
4406      res.getResource().add(parseCapabilityStatement2RestResourceComponent(xpp));
4407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
4408      res.getInteraction().add(parseCapabilityStatement2SystemInteractionComponent(xpp));
4409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
4410      res.getSearchParam().add(parseCapabilityStatement2RestResourceSearchParamComponent(xpp));
4411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
4412      res.getOperation().add(parseCapabilityStatement2RestResourceOperationComponent(xpp));
4413    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
4414      res.getCompartment().add(parseCanonical(xpp));
4415    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4416      return false;
4417    }
4418    return true;
4419  }
4420
4421  protected CapabilityStatement2.CapabilityStatement2RestFeatureComponent parseCapabilityStatement2RestFeatureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4422    CapabilityStatement2.CapabilityStatement2RestFeatureComponent res = new CapabilityStatement2.CapabilityStatement2RestFeatureComponent();
4423    parseElementAttributes(xpp, res);
4424    next(xpp);
4425    int eventType = nextNoWhitespace(xpp);
4426    while (eventType != XmlPullParser.END_TAG) {
4427    if (!parseCapabilityStatement2RestFeatureComponentContent(eventType, xpp, res))
4428        unknownContent(xpp);
4429      eventType = nextNoWhitespace(xpp);
4430    }
4431    next(xpp);
4432    parseElementClose(res);
4433    return res;
4434  }
4435
4436  protected boolean parseCapabilityStatement2RestFeatureComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2RestFeatureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4437    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4438      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement2.CapabilityFeature.NULL, new CapabilityStatement2.CapabilityFeatureEnumFactory()));
4439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4440      res.setValueElement(parseEnumeration(xpp, CapabilityStatement2.CapabilityFeatureValue.NULL, new CapabilityStatement2.CapabilityFeatureValueEnumFactory()));
4441    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4442      return false;
4443    }
4444    return true;
4445  }
4446
4447  protected CapabilityStatement2.CapabilityStatement2RestResourceComponent parseCapabilityStatement2RestResourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4448    CapabilityStatement2.CapabilityStatement2RestResourceComponent res = new CapabilityStatement2.CapabilityStatement2RestResourceComponent();
4449    parseElementAttributes(xpp, res);
4450    next(xpp);
4451    int eventType = nextNoWhitespace(xpp);
4452    while (eventType != XmlPullParser.END_TAG) {
4453    if (!parseCapabilityStatement2RestResourceComponentContent(eventType, xpp, res))
4454        unknownContent(xpp);
4455      eventType = nextNoWhitespace(xpp);
4456    }
4457    next(xpp);
4458    parseElementClose(res);
4459    return res;
4460  }
4461
4462  protected boolean parseCapabilityStatement2RestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2RestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4463    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4464      res.setTypeElement(parseCode(xpp));
4465    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
4466      res.setProfileElement(parseCanonical(xpp));
4467    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedProfile")) {
4468      res.getSupportedProfile().add(parseCanonical(xpp));
4469    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4470      res.setDocumentationElement(parseMarkdown(xpp));
4471    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4472      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4473    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
4474      res.getInteraction().add(parseCapabilityStatement2ResourceInteractionComponent(xpp));
4475    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
4476      res.getSearchParam().add(parseCapabilityStatement2RestResourceSearchParamComponent(xpp));
4477    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
4478      res.getOperation().add(parseCapabilityStatement2RestResourceOperationComponent(xpp));
4479    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4480      return false;
4481    }
4482    return true;
4483  }
4484
4485  protected CapabilityStatement2.ResourceInteractionComponent parseCapabilityStatement2ResourceInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4486    CapabilityStatement2.ResourceInteractionComponent res = new CapabilityStatement2.ResourceInteractionComponent();
4487    parseElementAttributes(xpp, res);
4488    next(xpp);
4489    int eventType = nextNoWhitespace(xpp);
4490    while (eventType != XmlPullParser.END_TAG) {
4491    if (!parseCapabilityStatement2ResourceInteractionComponentContent(eventType, xpp, res))
4492        unknownContent(xpp);
4493      eventType = nextNoWhitespace(xpp);
4494    }
4495    next(xpp);
4496    parseElementClose(res);
4497    return res;
4498  }
4499
4500  protected boolean parseCapabilityStatement2ResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4501    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4502      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement2.TypeRestfulInteraction.NULL, new CapabilityStatement2.TypeRestfulInteractionEnumFactory()));
4503    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4504      res.setDocumentationElement(parseMarkdown(xpp));
4505    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4506      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4507    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4508      return false;
4509    }
4510    return true;
4511  }
4512
4513  protected CapabilityStatement2.CapabilityStatement2RestResourceSearchParamComponent parseCapabilityStatement2RestResourceSearchParamComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4514    CapabilityStatement2.CapabilityStatement2RestResourceSearchParamComponent res = new CapabilityStatement2.CapabilityStatement2RestResourceSearchParamComponent();
4515    parseElementAttributes(xpp, res);
4516    next(xpp);
4517    int eventType = nextNoWhitespace(xpp);
4518    while (eventType != XmlPullParser.END_TAG) {
4519    if (!parseCapabilityStatement2RestResourceSearchParamComponentContent(eventType, xpp, res))
4520        unknownContent(xpp);
4521      eventType = nextNoWhitespace(xpp);
4522    }
4523    next(xpp);
4524    parseElementClose(res);
4525    return res;
4526  }
4527
4528  protected boolean parseCapabilityStatement2RestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2RestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4529    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4530      res.setNameElement(parseString(xpp));
4531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4532      res.setDefinitionElement(parseCanonical(xpp));
4533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4534      res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
4535    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4536      res.setDocumentationElement(parseMarkdown(xpp));
4537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4538      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4539    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4540      return false;
4541    }
4542    return true;
4543  }
4544
4545  protected CapabilityStatement2.CapabilityStatement2RestResourceOperationComponent parseCapabilityStatement2RestResourceOperationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4546    CapabilityStatement2.CapabilityStatement2RestResourceOperationComponent res = new CapabilityStatement2.CapabilityStatement2RestResourceOperationComponent();
4547    parseElementAttributes(xpp, res);
4548    next(xpp);
4549    int eventType = nextNoWhitespace(xpp);
4550    while (eventType != XmlPullParser.END_TAG) {
4551    if (!parseCapabilityStatement2RestResourceOperationComponentContent(eventType, xpp, res))
4552        unknownContent(xpp);
4553      eventType = nextNoWhitespace(xpp);
4554    }
4555    next(xpp);
4556    parseElementClose(res);
4557    return res;
4558  }
4559
4560  protected boolean parseCapabilityStatement2RestResourceOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.CapabilityStatement2RestResourceOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4561    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4562      res.setNameElement(parseString(xpp));
4563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4564      res.setDefinitionElement(parseCanonical(xpp));
4565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4566      res.setDocumentationElement(parseMarkdown(xpp));
4567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4568      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4569    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4570      return false;
4571    }
4572    return true;
4573  }
4574
4575  protected CapabilityStatement2.SystemInteractionComponent parseCapabilityStatement2SystemInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4576    CapabilityStatement2.SystemInteractionComponent res = new CapabilityStatement2.SystemInteractionComponent();
4577    parseElementAttributes(xpp, res);
4578    next(xpp);
4579    int eventType = nextNoWhitespace(xpp);
4580    while (eventType != XmlPullParser.END_TAG) {
4581    if (!parseCapabilityStatement2SystemInteractionComponentContent(eventType, xpp, res))
4582        unknownContent(xpp);
4583      eventType = nextNoWhitespace(xpp);
4584    }
4585    next(xpp);
4586    parseElementClose(res);
4587    return res;
4588  }
4589
4590  protected boolean parseCapabilityStatement2SystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement2.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4591    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4592      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement2.SystemRestfulInteraction.NULL, new CapabilityStatement2.SystemRestfulInteractionEnumFactory()));
4593    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4594      res.setDocumentationElement(parseMarkdown(xpp));
4595    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("feature")) {
4596      res.getFeature().add(parseCapabilityStatement2RestFeatureComponent(xpp));
4597    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4598      return false;
4599    }
4600    return true;
4601  }
4602
4603  protected CarePlan parseCarePlan(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4604    CarePlan res = new CarePlan();
4605    parseResourceAttributes(xpp, res);
4606    next(xpp);
4607    int eventType = nextNoWhitespace(xpp);
4608    while (eventType != XmlPullParser.END_TAG) {
4609    if (!parseCarePlanContent(eventType, xpp, res))
4610        unknownContent(xpp);
4611      eventType = nextNoWhitespace(xpp);
4612    }
4613    next(xpp);
4614    parseElementClose(res);
4615    return res;
4616  }
4617
4618  protected boolean parseCarePlanContent(int eventType, XmlPullParser xpp, CarePlan res) throws XmlPullParserException, IOException, FHIRFormatError {
4619    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4620      res.getIdentifier().add(parseIdentifier(xpp));
4621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesCanonical")) {
4622      res.getInstantiatesCanonical().add(parseCanonical(xpp));
4623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesUri")) {
4624      res.getInstantiatesUri().add(parseUri(xpp));
4625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4626      res.getBasedOn().add(parseReference(xpp));
4627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4628      res.getReplaces().add(parseReference(xpp));
4629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4630      res.getPartOf().add(parseReference(xpp));
4631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4632      res.setStatusElement(parseEnumeration(xpp, Enumerations.RequestStatus.NULL, new Enumerations.RequestStatusEnumFactory()));
4633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
4634      res.setIntentElement(parseEnumeration(xpp, CarePlan.CarePlanIntent.NULL, new CarePlan.CarePlanIntentEnumFactory()));
4635    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4636      res.getCategory().add(parseCodeableConcept(xpp));
4637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4638      res.setTitleElement(parseString(xpp));
4639    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4640      res.setDescriptionElement(parseString(xpp));
4641    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4642      res.setSubject(parseReference(xpp));
4643    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
4644      res.setEncounter(parseReference(xpp));
4645    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
4646      res.setPeriod(parsePeriod(xpp));
4647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
4648      res.setCreatedElement(parseDateTime(xpp));
4649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
4650      res.setAuthor(parseReference(xpp));
4651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
4652      res.getContributor().add(parseReference(xpp));
4653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
4654      res.getCareTeam().add(parseReference(xpp));
4655    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
4656      res.getAddresses().add(parseCodeableReference(xpp));
4657    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
4658      res.getSupportingInfo().add(parseReference(xpp));
4659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
4660      res.getGoal().add(parseReference(xpp));
4661    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
4662      res.getActivity().add(parseCarePlanActivityComponent(xpp));
4663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4664      res.getNote().add(parseAnnotation(xpp));
4665    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4666      return false;
4667    }
4668    return true;
4669  }
4670
4671  protected CarePlan.CarePlanActivityComponent parseCarePlanActivityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4672    CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent();
4673    parseElementAttributes(xpp, res);
4674    next(xpp);
4675    int eventType = nextNoWhitespace(xpp);
4676    while (eventType != XmlPullParser.END_TAG) {
4677    if (!parseCarePlanActivityComponentContent(eventType, xpp, res))
4678        unknownContent(xpp);
4679      eventType = nextNoWhitespace(xpp);
4680    }
4681    next(xpp);
4682    parseElementClose(res);
4683    return res;
4684  }
4685
4686  protected boolean parseCarePlanActivityComponentContent(int eventType, XmlPullParser xpp, CarePlan.CarePlanActivityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4687    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performedActivity")) {
4688      res.getPerformedActivity().add(parseCodeableReference(xpp));
4689    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("progress")) {
4690      res.getProgress().add(parseAnnotation(xpp));
4691    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plannedActivityReference")) {
4692      res.setPlannedActivityReference(parseReference(xpp));
4693    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plannedActivityDetail")) {
4694      res.setPlannedActivityDetail(parseCarePlanActivityPlannedActivityDetailComponent(xpp));
4695    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4696      return false;
4697    }
4698    return true;
4699  }
4700
4701  protected CarePlan.CarePlanActivityPlannedActivityDetailComponent parseCarePlanActivityPlannedActivityDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4702    CarePlan.CarePlanActivityPlannedActivityDetailComponent res = new CarePlan.CarePlanActivityPlannedActivityDetailComponent();
4703    parseElementAttributes(xpp, res);
4704    next(xpp);
4705    int eventType = nextNoWhitespace(xpp);
4706    while (eventType != XmlPullParser.END_TAG) {
4707    if (!parseCarePlanActivityPlannedActivityDetailComponentContent(eventType, xpp, res))
4708        unknownContent(xpp);
4709      eventType = nextNoWhitespace(xpp);
4710    }
4711    next(xpp);
4712    parseElementClose(res);
4713    return res;
4714  }
4715
4716  protected boolean parseCarePlanActivityPlannedActivityDetailComponentContent(int eventType, XmlPullParser xpp, CarePlan.CarePlanActivityPlannedActivityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4717    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
4718      res.setKindElement(parseEnumeration(xpp, CarePlan.CarePlanActivityKind.NULL, new CarePlan.CarePlanActivityKindEnumFactory()));
4719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesCanonical")) {
4720      res.getInstantiatesCanonical().add(parseCanonical(xpp));
4721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesUri")) {
4722      res.getInstantiatesUri().add(parseUri(xpp));
4723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4724      res.setCode(parseCodeableConcept(xpp));
4725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4726      res.getReason().add(parseCodeableReference(xpp));
4727    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
4728      res.getGoal().add(parseReference(xpp));
4729    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4730      res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanActivityStatus.NULL, new CarePlan.CarePlanActivityStatusEnumFactory()));
4731    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
4732      res.setStatusReason(parseCodeableConcept(xpp));
4733    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
4734      res.setDoNotPerformElement(parseBoolean(xpp));
4735    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "scheduled")) {
4736      res.setScheduled(parseType("scheduled", xpp));
4737    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
4738      res.setLocation(parseCodeableReference(xpp));
4739    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "reported")) {
4740      res.setReported(parseType("reported", xpp));
4741    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
4742      res.getPerformer().add(parseReference(xpp));
4743    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
4744      res.setProduct(parseType("product", xpp));
4745    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dailyAmount")) {
4746      res.setDailyAmount(parseQuantity(xpp));
4747    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4748      res.setQuantity(parseQuantity(xpp));
4749    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4750      res.setDescriptionElement(parseString(xpp));
4751    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4752      return false;
4753    }
4754    return true;
4755  }
4756
4757  protected CareTeam parseCareTeam(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4758    CareTeam res = new CareTeam();
4759    parseResourceAttributes(xpp, res);
4760    next(xpp);
4761    int eventType = nextNoWhitespace(xpp);
4762    while (eventType != XmlPullParser.END_TAG) {
4763    if (!parseCareTeamContent(eventType, xpp, res))
4764        unknownContent(xpp);
4765      eventType = nextNoWhitespace(xpp);
4766    }
4767    next(xpp);
4768    parseElementClose(res);
4769    return res;
4770  }
4771
4772  protected boolean parseCareTeamContent(int eventType, XmlPullParser xpp, CareTeam res) throws XmlPullParserException, IOException, FHIRFormatError {
4773    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4774      res.getIdentifier().add(parseIdentifier(xpp));
4775    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4776      res.setStatusElement(parseEnumeration(xpp, CareTeam.CareTeamStatus.NULL, new CareTeam.CareTeamStatusEnumFactory()));
4777    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4778      res.getCategory().add(parseCodeableConcept(xpp));
4779    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4780      res.setNameElement(parseString(xpp));
4781    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4782      res.setSubject(parseReference(xpp));
4783    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
4784      res.setPeriod(parsePeriod(xpp));
4785    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
4786      res.getParticipant().add(parseCareTeamParticipantComponent(xpp));
4787    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4788      res.getReason().add(parseCodeableReference(xpp));
4789    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
4790      res.getManagingOrganization().add(parseReference(xpp));
4791    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
4792      res.getTelecom().add(parseContactPoint(xpp));
4793    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4794      res.getNote().add(parseAnnotation(xpp));
4795    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4796      return false;
4797    }
4798    return true;
4799  }
4800
4801  protected CareTeam.CareTeamParticipantComponent parseCareTeamParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4802    CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent();
4803    parseElementAttributes(xpp, res);
4804    next(xpp);
4805    int eventType = nextNoWhitespace(xpp);
4806    while (eventType != XmlPullParser.END_TAG) {
4807    if (!parseCareTeamParticipantComponentContent(eventType, xpp, res))
4808        unknownContent(xpp);
4809      eventType = nextNoWhitespace(xpp);
4810    }
4811    next(xpp);
4812    parseElementClose(res);
4813    return res;
4814  }
4815
4816  protected boolean parseCareTeamParticipantComponentContent(int eventType, XmlPullParser xpp, CareTeam.CareTeamParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4817    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
4818      res.setRole(parseCodeableConcept(xpp));
4819    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
4820      res.setMember(parseReference(xpp));
4821    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
4822      res.setOnBehalfOf(parseReference(xpp));
4823    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "coverage")) {
4824      res.setCoverage(parseType("coverage", xpp));
4825    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4826      return false;
4827    }
4828    return true;
4829  }
4830
4831  protected ChargeItem parseChargeItem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4832    ChargeItem res = new ChargeItem();
4833    parseResourceAttributes(xpp, res);
4834    next(xpp);
4835    int eventType = nextNoWhitespace(xpp);
4836    while (eventType != XmlPullParser.END_TAG) {
4837    if (!parseChargeItemContent(eventType, xpp, res))
4838        unknownContent(xpp);
4839      eventType = nextNoWhitespace(xpp);
4840    }
4841    next(xpp);
4842    parseElementClose(res);
4843    return res;
4844  }
4845
4846  protected boolean parseChargeItemContent(int eventType, XmlPullParser xpp, ChargeItem res) throws XmlPullParserException, IOException, FHIRFormatError {
4847    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4848      res.getIdentifier().add(parseIdentifier(xpp));
4849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definitionUri")) {
4850      res.getDefinitionUri().add(parseUri(xpp));
4851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definitionCanonical")) {
4852      res.getDefinitionCanonical().add(parseCanonical(xpp));
4853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4854      res.setStatusElement(parseEnumeration(xpp, ChargeItem.ChargeItemStatus.NULL, new ChargeItem.ChargeItemStatusEnumFactory()));
4855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4856      res.getPartOf().add(parseReference(xpp));
4857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4858      res.setCode(parseCodeableConcept(xpp));
4859    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4860      res.setSubject(parseReference(xpp));
4861    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4862      res.setContext(parseReference(xpp));
4863    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
4864      res.setOccurrence(parseType("occurrence", xpp));
4865    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
4866      res.getPerformer().add(parseChargeItemPerformerComponent(xpp));
4867    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performingOrganization")) {
4868      res.setPerformingOrganization(parseReference(xpp));
4869    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestingOrganization")) {
4870      res.setRequestingOrganization(parseReference(xpp));
4871    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("costCenter")) {
4872      res.setCostCenter(parseReference(xpp));
4873    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4874      res.setQuantity(parseQuantity(xpp));
4875    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodysite")) {
4876      res.getBodysite().add(parseCodeableConcept(xpp));
4877    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factorOverride")) {
4878      res.setFactorOverrideElement(parseDecimal(xpp));
4879    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceOverride")) {
4880      res.setPriceOverride(parseMoney(xpp));
4881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overrideReason")) {
4882      res.setOverrideReasonElement(parseString(xpp));
4883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
4884      res.setEnterer(parseReference(xpp));
4885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteredDate")) {
4886      res.setEnteredDateElement(parseDateTime(xpp));
4887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4888      res.getReason().add(parseCodeableConcept(xpp));
4889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4890      res.getService().add(parseReference(xpp));
4891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
4892      res.getProduct().add(parseCodeableReference(xpp));
4893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
4894      res.getAccount().add(parseReference(xpp));
4895    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4896      res.getNote().add(parseAnnotation(xpp));
4897    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
4898      res.getSupportingInformation().add(parseReference(xpp));
4899    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4900      return false;
4901    }
4902    return true;
4903  }
4904
4905  protected ChargeItem.ChargeItemPerformerComponent parseChargeItemPerformerComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4906    ChargeItem.ChargeItemPerformerComponent res = new ChargeItem.ChargeItemPerformerComponent();
4907    parseElementAttributes(xpp, res);
4908    next(xpp);
4909    int eventType = nextNoWhitespace(xpp);
4910    while (eventType != XmlPullParser.END_TAG) {
4911    if (!parseChargeItemPerformerComponentContent(eventType, xpp, res))
4912        unknownContent(xpp);
4913      eventType = nextNoWhitespace(xpp);
4914    }
4915    next(xpp);
4916    parseElementClose(res);
4917    return res;
4918  }
4919
4920  protected boolean parseChargeItemPerformerComponentContent(int eventType, XmlPullParser xpp, ChargeItem.ChargeItemPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4921    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
4922      res.setFunction(parseCodeableConcept(xpp));
4923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
4924      res.setActor(parseReference(xpp));
4925    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4926      return false;
4927    }
4928    return true;
4929  }
4930
4931  protected ChargeItemDefinition parseChargeItemDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4932    ChargeItemDefinition res = new ChargeItemDefinition();
4933    parseResourceAttributes(xpp, res);
4934    next(xpp);
4935    int eventType = nextNoWhitespace(xpp);
4936    while (eventType != XmlPullParser.END_TAG) {
4937    if (!parseChargeItemDefinitionContent(eventType, xpp, res))
4938        unknownContent(xpp);
4939      eventType = nextNoWhitespace(xpp);
4940    }
4941    next(xpp);
4942    parseElementClose(res);
4943    return res;
4944  }
4945
4946  protected boolean parseChargeItemDefinitionContent(int eventType, XmlPullParser xpp, ChargeItemDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
4947    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4948      res.setUrlElement(parseUri(xpp));
4949    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4950      res.getIdentifier().add(parseIdentifier(xpp));
4951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4952      res.setVersionElement(parseString(xpp));
4953    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4954      res.setTitleElement(parseString(xpp));
4955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivedFromUri")) {
4956      res.getDerivedFromUri().add(parseUri(xpp));
4957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4958      res.getPartOf().add(parseCanonical(xpp));
4959    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4960      res.getReplaces().add(parseCanonical(xpp));
4961    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4962      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4963    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4964      res.setExperimentalElement(parseBoolean(xpp));
4965    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4966      res.setDateElement(parseDateTime(xpp));
4967    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4968      res.setPublisherElement(parseString(xpp));
4969    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4970      res.getContact().add(parseContactDetail(xpp));
4971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4972      res.setDescriptionElement(parseMarkdown(xpp));
4973    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4974      res.getUseContext().add(parseUsageContext(xpp));
4975    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4976      res.getJurisdiction().add(parseCodeableConcept(xpp));
4977    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4978      res.setCopyrightElement(parseMarkdown(xpp));
4979    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
4980      res.setApprovalDateElement(parseDate(xpp));
4981    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
4982      res.setLastReviewDateElement(parseDate(xpp));
4983    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
4984      res.setEffectivePeriod(parsePeriod(xpp));
4985    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4986      res.setCode(parseCodeableConcept(xpp));
4987    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
4988      res.getInstance().add(parseReference(xpp));
4989    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
4990      res.getApplicability().add(parseChargeItemDefinitionApplicabilityComponent(xpp));
4991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("propertyGroup")) {
4992      res.getPropertyGroup().add(parseChargeItemDefinitionPropertyGroupComponent(xpp));
4993    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
4994      return false;
4995    }
4996    return true;
4997  }
4998
4999  protected ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent parseChargeItemDefinitionApplicabilityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5000    ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res = new ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent();
5001    parseElementAttributes(xpp, res);
5002    next(xpp);
5003    int eventType = nextNoWhitespace(xpp);
5004    while (eventType != XmlPullParser.END_TAG) {
5005    if (!parseChargeItemDefinitionApplicabilityComponentContent(eventType, xpp, res))
5006        unknownContent(xpp);
5007      eventType = nextNoWhitespace(xpp);
5008    }
5009    next(xpp);
5010    parseElementClose(res);
5011    return res;
5012  }
5013
5014  protected boolean parseChargeItemDefinitionApplicabilityComponentContent(int eventType, XmlPullParser xpp, ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5015    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5016      res.setDescriptionElement(parseString(xpp));
5017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5018      res.setLanguageElement(parseString(xpp));
5019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
5020      res.setExpressionElement(parseString(xpp));
5021    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5022      return false;
5023    }
5024    return true;
5025  }
5026
5027  protected ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent parseChargeItemDefinitionPropertyGroupComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5028    ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res = new ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent();
5029    parseElementAttributes(xpp, res);
5030    next(xpp);
5031    int eventType = nextNoWhitespace(xpp);
5032    while (eventType != XmlPullParser.END_TAG) {
5033    if (!parseChargeItemDefinitionPropertyGroupComponentContent(eventType, xpp, res))
5034        unknownContent(xpp);
5035      eventType = nextNoWhitespace(xpp);
5036    }
5037    next(xpp);
5038    parseElementClose(res);
5039    return res;
5040  }
5041
5042  protected boolean parseChargeItemDefinitionPropertyGroupComponentContent(int eventType, XmlPullParser xpp, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5043    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
5044      res.getApplicability().add(parseChargeItemDefinitionApplicabilityComponent(xpp));
5045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceComponent")) {
5046      res.getPriceComponent().add(parseChargeItemDefinitionPropertyGroupPriceComponentComponent(xpp));
5047    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5048      return false;
5049    }
5050    return true;
5051  }
5052
5053  protected ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent parseChargeItemDefinitionPropertyGroupPriceComponentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5054    ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent res = new ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent();
5055    parseElementAttributes(xpp, res);
5056    next(xpp);
5057    int eventType = nextNoWhitespace(xpp);
5058    while (eventType != XmlPullParser.END_TAG) {
5059    if (!parseChargeItemDefinitionPropertyGroupPriceComponentComponentContent(eventType, xpp, res))
5060        unknownContent(xpp);
5061      eventType = nextNoWhitespace(xpp);
5062    }
5063    next(xpp);
5064    parseElementClose(res);
5065    return res;
5066  }
5067
5068  protected boolean parseChargeItemDefinitionPropertyGroupPriceComponentComponentContent(int eventType, XmlPullParser xpp, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupPriceComponentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5069    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5070      res.setTypeElement(parseEnumeration(xpp, Enumerations.InvoicePriceComponentType.NULL, new Enumerations.InvoicePriceComponentTypeEnumFactory()));
5071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5072      res.setCode(parseCodeableConcept(xpp));
5073    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
5074      res.setFactorElement(parseDecimal(xpp));
5075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
5076      res.setAmount(parseMoney(xpp));
5077    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5078      return false;
5079    }
5080    return true;
5081  }
5082
5083  protected Citation parseCitation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5084    Citation res = new Citation();
5085    parseResourceAttributes(xpp, res);
5086    next(xpp);
5087    int eventType = nextNoWhitespace(xpp);
5088    while (eventType != XmlPullParser.END_TAG) {
5089    if (!parseCitationContent(eventType, xpp, res))
5090        unknownContent(xpp);
5091      eventType = nextNoWhitespace(xpp);
5092    }
5093    next(xpp);
5094    parseElementClose(res);
5095    return res;
5096  }
5097
5098  protected boolean parseCitationContent(int eventType, XmlPullParser xpp, Citation res) throws XmlPullParserException, IOException, FHIRFormatError {
5099    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5100      res.setUrlElement(parseUri(xpp));
5101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5102      res.getIdentifier().add(parseIdentifier(xpp));
5103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5104      res.setVersionElement(parseString(xpp));
5105    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5106      res.setNameElement(parseString(xpp));
5107    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5108      res.setTitleElement(parseString(xpp));
5109    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5110      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5111    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5112      res.setExperimentalElement(parseBoolean(xpp));
5113    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5114      res.setDateElement(parseDateTime(xpp));
5115    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5116      res.setPublisherElement(parseString(xpp));
5117    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5118      res.getContact().add(parseContactDetail(xpp));
5119    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5120      res.setDescriptionElement(parseMarkdown(xpp));
5121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5122      res.getUseContext().add(parseUsageContext(xpp));
5123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5124      res.getJurisdiction().add(parseCodeableConcept(xpp));
5125    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5126      res.setPurposeElement(parseMarkdown(xpp));
5127    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5128      res.setCopyrightElement(parseMarkdown(xpp));
5129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
5130      res.setApprovalDateElement(parseDate(xpp));
5131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
5132      res.setLastReviewDateElement(parseDate(xpp));
5133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
5134      res.setEffectivePeriod(parsePeriod(xpp));
5135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
5136      res.getAuthor().add(parseContactDetail(xpp));
5137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
5138      res.getEditor().add(parseContactDetail(xpp));
5139    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
5140      res.getReviewer().add(parseContactDetail(xpp));
5141    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
5142      res.getEndorser().add(parseContactDetail(xpp));
5143    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5144      res.getSummary().add(parseCitationSummaryComponent(xpp));
5145    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
5146      res.getClassification().add(parseCitationClassificationComponent(xpp));
5147    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5148      res.getNote().add(parseAnnotation(xpp));
5149    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currentState")) {
5150      res.getCurrentState().add(parseCodeableConcept(xpp));
5151    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
5152      res.getStatusDate().add(parseCitationStatusDateComponent(xpp));
5153    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
5154      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
5155    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citedArtifact")) {
5156      res.setCitedArtifact(parseCitationCitedArtifactComponent(xpp));
5157    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
5158      return false;
5159    }
5160    return true;
5161  }
5162
5163  protected Citation.CitationSummaryComponent parseCitationSummaryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5164    Citation.CitationSummaryComponent res = new Citation.CitationSummaryComponent();
5165    parseElementAttributes(xpp, res);
5166    next(xpp);
5167    int eventType = nextNoWhitespace(xpp);
5168    while (eventType != XmlPullParser.END_TAG) {
5169    if (!parseCitationSummaryComponentContent(eventType, xpp, res))
5170        unknownContent(xpp);
5171      eventType = nextNoWhitespace(xpp);
5172    }
5173    next(xpp);
5174    parseElementClose(res);
5175    return res;
5176  }
5177
5178  protected boolean parseCitationSummaryComponentContent(int eventType, XmlPullParser xpp, Citation.CitationSummaryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5179    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("style")) {
5180      res.setStyle(parseCodeableConcept(xpp));
5181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5182      res.setTextElement(parseMarkdown(xpp));
5183    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5184      return false;
5185    }
5186    return true;
5187  }
5188
5189  protected Citation.CitationClassificationComponent parseCitationClassificationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5190    Citation.CitationClassificationComponent res = new Citation.CitationClassificationComponent();
5191    parseElementAttributes(xpp, res);
5192    next(xpp);
5193    int eventType = nextNoWhitespace(xpp);
5194    while (eventType != XmlPullParser.END_TAG) {
5195    if (!parseCitationClassificationComponentContent(eventType, xpp, res))
5196        unknownContent(xpp);
5197      eventType = nextNoWhitespace(xpp);
5198    }
5199    next(xpp);
5200    parseElementClose(res);
5201    return res;
5202  }
5203
5204  protected boolean parseCitationClassificationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationClassificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5205    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5206      res.setType(parseCodeableConcept(xpp));
5207    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5208      res.getClassifier().add(parseCodeableConcept(xpp));
5209    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5210      return false;
5211    }
5212    return true;
5213  }
5214
5215  protected Citation.CitationStatusDateComponent parseCitationStatusDateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5216    Citation.CitationStatusDateComponent res = new Citation.CitationStatusDateComponent();
5217    parseElementAttributes(xpp, res);
5218    next(xpp);
5219    int eventType = nextNoWhitespace(xpp);
5220    while (eventType != XmlPullParser.END_TAG) {
5221    if (!parseCitationStatusDateComponentContent(eventType, xpp, res))
5222        unknownContent(xpp);
5223      eventType = nextNoWhitespace(xpp);
5224    }
5225    next(xpp);
5226    parseElementClose(res);
5227    return res;
5228  }
5229
5230  protected boolean parseCitationStatusDateComponentContent(int eventType, XmlPullParser xpp, Citation.CitationStatusDateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5231    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
5232      res.setActivity(parseCodeableConcept(xpp));
5233    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actual")) {
5234      res.setActualElement(parseBoolean(xpp));
5235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5236      res.setPeriod(parsePeriod(xpp));
5237    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5238      return false;
5239    }
5240    return true;
5241  }
5242
5243  protected Citation.CitationCitedArtifactComponent parseCitationCitedArtifactComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5244    Citation.CitationCitedArtifactComponent res = new Citation.CitationCitedArtifactComponent();
5245    parseElementAttributes(xpp, res);
5246    next(xpp);
5247    int eventType = nextNoWhitespace(xpp);
5248    while (eventType != XmlPullParser.END_TAG) {
5249    if (!parseCitationCitedArtifactComponentContent(eventType, xpp, res))
5250        unknownContent(xpp);
5251      eventType = nextNoWhitespace(xpp);
5252    }
5253    next(xpp);
5254    parseElementClose(res);
5255    return res;
5256  }
5257
5258  protected boolean parseCitationCitedArtifactComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5259    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5260      res.getIdentifier().add(parseIdentifier(xpp));
5261    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedIdentifier")) {
5262      res.getRelatedIdentifier().add(parseIdentifier(xpp));
5263    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateAccessed")) {
5264      res.setDateAccessedElement(parseDateTime(xpp));
5265    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5266      res.setVersion(parseCitationCitedArtifactVersionComponent(xpp));
5267    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currentState")) {
5268      res.getCurrentState().add(parseCodeableConcept(xpp));
5269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
5270      res.getStatusDate().add(parseCitationCitedArtifactStatusDateComponent(xpp));
5271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5272      res.getTitle().add(parseCitationCitedArtifactTitleComponent(xpp));
5273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("abstract")) {
5274      res.getAbstract().add(parseCitationCitedArtifactAbstractComponent(xpp));
5275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
5276      res.setPart(parseCitationCitedArtifactPartComponent(xpp));
5277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
5278      res.getRelatesTo().add(parseRelatedArtifact(xpp));
5279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationForm")) {
5280      res.getPublicationForm().add(parseCitationCitedArtifactPublicationFormComponent(xpp));
5281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("webLocation")) {
5282      res.getWebLocation().add(parseCitationCitedArtifactWebLocationComponent(xpp));
5283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
5284      res.getClassification().add(parseCitationCitedArtifactClassificationComponent(xpp));
5285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributorship")) {
5286      res.setContributorship(parseCitationCitedArtifactContributorshipComponent(xpp));
5287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5288      res.getNote().add(parseAnnotation(xpp));
5289    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5290      return false;
5291    }
5292    return true;
5293  }
5294
5295  protected Citation.CitationCitedArtifactVersionComponent parseCitationCitedArtifactVersionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5296    Citation.CitationCitedArtifactVersionComponent res = new Citation.CitationCitedArtifactVersionComponent();
5297    parseElementAttributes(xpp, res);
5298    next(xpp);
5299    int eventType = nextNoWhitespace(xpp);
5300    while (eventType != XmlPullParser.END_TAG) {
5301    if (!parseCitationCitedArtifactVersionComponentContent(eventType, xpp, res))
5302        unknownContent(xpp);
5303      eventType = nextNoWhitespace(xpp);
5304    }
5305    next(xpp);
5306    parseElementClose(res);
5307    return res;
5308  }
5309
5310  protected boolean parseCitationCitedArtifactVersionComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactVersionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5311    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
5312      res.setValueElement(parseString(xpp));
5313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseCitation")) {
5314      res.setBaseCitation(parseReference(xpp));
5315    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5316      return false;
5317    }
5318    return true;
5319  }
5320
5321  protected Citation.CitationCitedArtifactStatusDateComponent parseCitationCitedArtifactStatusDateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5322    Citation.CitationCitedArtifactStatusDateComponent res = new Citation.CitationCitedArtifactStatusDateComponent();
5323    parseElementAttributes(xpp, res);
5324    next(xpp);
5325    int eventType = nextNoWhitespace(xpp);
5326    while (eventType != XmlPullParser.END_TAG) {
5327    if (!parseCitationCitedArtifactStatusDateComponentContent(eventType, xpp, res))
5328        unknownContent(xpp);
5329      eventType = nextNoWhitespace(xpp);
5330    }
5331    next(xpp);
5332    parseElementClose(res);
5333    return res;
5334  }
5335
5336  protected boolean parseCitationCitedArtifactStatusDateComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactStatusDateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5337    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
5338      res.setActivity(parseCodeableConcept(xpp));
5339    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actual")) {
5340      res.setActualElement(parseBoolean(xpp));
5341    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5342      res.setPeriod(parsePeriod(xpp));
5343    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5344      return false;
5345    }
5346    return true;
5347  }
5348
5349  protected Citation.CitationCitedArtifactTitleComponent parseCitationCitedArtifactTitleComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5350    Citation.CitationCitedArtifactTitleComponent res = new Citation.CitationCitedArtifactTitleComponent();
5351    parseElementAttributes(xpp, res);
5352    next(xpp);
5353    int eventType = nextNoWhitespace(xpp);
5354    while (eventType != XmlPullParser.END_TAG) {
5355    if (!parseCitationCitedArtifactTitleComponentContent(eventType, xpp, res))
5356        unknownContent(xpp);
5357      eventType = nextNoWhitespace(xpp);
5358    }
5359    next(xpp);
5360    parseElementClose(res);
5361    return res;
5362  }
5363
5364  protected boolean parseCitationCitedArtifactTitleComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactTitleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5365    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5366      res.getType().add(parseCodeableConcept(xpp));
5367    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5368      res.setLanguage(parseCodeableConcept(xpp));
5369    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5370      res.setTextElement(parseMarkdown(xpp));
5371    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5372      return false;
5373    }
5374    return true;
5375  }
5376
5377  protected Citation.CitationCitedArtifactAbstractComponent parseCitationCitedArtifactAbstractComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5378    Citation.CitationCitedArtifactAbstractComponent res = new Citation.CitationCitedArtifactAbstractComponent();
5379    parseElementAttributes(xpp, res);
5380    next(xpp);
5381    int eventType = nextNoWhitespace(xpp);
5382    while (eventType != XmlPullParser.END_TAG) {
5383    if (!parseCitationCitedArtifactAbstractComponentContent(eventType, xpp, res))
5384        unknownContent(xpp);
5385      eventType = nextNoWhitespace(xpp);
5386    }
5387    next(xpp);
5388    parseElementClose(res);
5389    return res;
5390  }
5391
5392  protected boolean parseCitationCitedArtifactAbstractComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactAbstractComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5393    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5394      res.setType(parseCodeableConcept(xpp));
5395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5396      res.setLanguage(parseCodeableConcept(xpp));
5397    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5398      res.setTextElement(parseMarkdown(xpp));
5399    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5400      res.setCopyrightElement(parseMarkdown(xpp));
5401    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5402      return false;
5403    }
5404    return true;
5405  }
5406
5407  protected Citation.CitationCitedArtifactPartComponent parseCitationCitedArtifactPartComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5408    Citation.CitationCitedArtifactPartComponent res = new Citation.CitationCitedArtifactPartComponent();
5409    parseElementAttributes(xpp, res);
5410    next(xpp);
5411    int eventType = nextNoWhitespace(xpp);
5412    while (eventType != XmlPullParser.END_TAG) {
5413    if (!parseCitationCitedArtifactPartComponentContent(eventType, xpp, res))
5414        unknownContent(xpp);
5415      eventType = nextNoWhitespace(xpp);
5416    }
5417    next(xpp);
5418    parseElementClose(res);
5419    return res;
5420  }
5421
5422  protected boolean parseCitationCitedArtifactPartComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPartComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5423    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5424      res.setType(parseCodeableConcept(xpp));
5425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
5426      res.setValueElement(parseString(xpp));
5427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseCitation")) {
5428      res.setBaseCitation(parseReference(xpp));
5429    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5430      return false;
5431    }
5432    return true;
5433  }
5434
5435  protected Citation.CitationCitedArtifactPublicationFormComponent parseCitationCitedArtifactPublicationFormComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5436    Citation.CitationCitedArtifactPublicationFormComponent res = new Citation.CitationCitedArtifactPublicationFormComponent();
5437    parseElementAttributes(xpp, res);
5438    next(xpp);
5439    int eventType = nextNoWhitespace(xpp);
5440    while (eventType != XmlPullParser.END_TAG) {
5441    if (!parseCitationCitedArtifactPublicationFormComponentContent(eventType, xpp, res))
5442        unknownContent(xpp);
5443      eventType = nextNoWhitespace(xpp);
5444    }
5445    next(xpp);
5446    parseElementClose(res);
5447    return res;
5448  }
5449
5450  protected boolean parseCitationCitedArtifactPublicationFormComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5451    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publishedIn")) {
5452      res.setPublishedIn(parseCitationCitedArtifactPublicationFormPublishedInComponent(xpp));
5453    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodicRelease")) {
5454      res.setPeriodicRelease(parseCitationCitedArtifactPublicationFormPeriodicReleaseComponent(xpp));
5455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("articleDate")) {
5456      res.setArticleDateElement(parseDateTime(xpp));
5457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastRevisionDate")) {
5458      res.setLastRevisionDateElement(parseDateTime(xpp));
5459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5460      res.getLanguage().add(parseCodeableConcept(xpp));
5461    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accessionNumber")) {
5462      res.setAccessionNumberElement(parseString(xpp));
5463    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pageString")) {
5464      res.setPageStringElement(parseString(xpp));
5465    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("firstPage")) {
5466      res.setFirstPageElement(parseString(xpp));
5467    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastPage")) {
5468      res.setLastPageElement(parseString(xpp));
5469    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pageCount")) {
5470      res.setPageCountElement(parseString(xpp));
5471    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5472      res.setCopyrightElement(parseMarkdown(xpp));
5473    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5474      return false;
5475    }
5476    return true;
5477  }
5478
5479  protected Citation.CitationCitedArtifactPublicationFormPublishedInComponent parseCitationCitedArtifactPublicationFormPublishedInComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5480    Citation.CitationCitedArtifactPublicationFormPublishedInComponent res = new Citation.CitationCitedArtifactPublicationFormPublishedInComponent();
5481    parseElementAttributes(xpp, res);
5482    next(xpp);
5483    int eventType = nextNoWhitespace(xpp);
5484    while (eventType != XmlPullParser.END_TAG) {
5485    if (!parseCitationCitedArtifactPublicationFormPublishedInComponentContent(eventType, xpp, res))
5486        unknownContent(xpp);
5487      eventType = nextNoWhitespace(xpp);
5488    }
5489    next(xpp);
5490    parseElementClose(res);
5491    return res;
5492  }
5493
5494  protected boolean parseCitationCitedArtifactPublicationFormPublishedInComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormPublishedInComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5495    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5496      res.setType(parseCodeableConcept(xpp));
5497    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5498      res.getIdentifier().add(parseIdentifier(xpp));
5499    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5500      res.setTitleElement(parseString(xpp));
5501    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5502      res.setPublisher(parseReference(xpp));
5503    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisherLocation")) {
5504      res.setPublisherLocationElement(parseString(xpp));
5505    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5506      return false;
5507    }
5508    return true;
5509  }
5510
5511  protected Citation.CitationCitedArtifactPublicationFormPeriodicReleaseComponent parseCitationCitedArtifactPublicationFormPeriodicReleaseComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5512    Citation.CitationCitedArtifactPublicationFormPeriodicReleaseComponent res = new Citation.CitationCitedArtifactPublicationFormPeriodicReleaseComponent();
5513    parseElementAttributes(xpp, res);
5514    next(xpp);
5515    int eventType = nextNoWhitespace(xpp);
5516    while (eventType != XmlPullParser.END_TAG) {
5517    if (!parseCitationCitedArtifactPublicationFormPeriodicReleaseComponentContent(eventType, xpp, res))
5518        unknownContent(xpp);
5519      eventType = nextNoWhitespace(xpp);
5520    }
5521    next(xpp);
5522    parseElementClose(res);
5523    return res;
5524  }
5525
5526  protected boolean parseCitationCitedArtifactPublicationFormPeriodicReleaseComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormPeriodicReleaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5527    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citedMedium")) {
5528      res.setCitedMedium(parseCodeableConcept(xpp));
5529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("volume")) {
5530      res.setVolumeElement(parseString(xpp));
5531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issue")) {
5532      res.setIssueElement(parseString(xpp));
5533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateOfPublication")) {
5534      res.setDateOfPublication(parseCitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(xpp));
5535    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5536      return false;
5537    }
5538    return true;
5539  }
5540
5541  protected Citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent parseCitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5542    Citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent res = new Citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent();
5543    parseElementAttributes(xpp, res);
5544    next(xpp);
5545    int eventType = nextNoWhitespace(xpp);
5546    while (eventType != XmlPullParser.END_TAG) {
5547    if (!parseCitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponentContent(eventType, xpp, res))
5548        unknownContent(xpp);
5549      eventType = nextNoWhitespace(xpp);
5550    }
5551    next(xpp);
5552    parseElementClose(res);
5553    return res;
5554  }
5555
5556  protected boolean parseCitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormPeriodicReleaseDateOfPublicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5557    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5558      res.setDateElement(parseDate(xpp));
5559    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("year")) {
5560      res.setYearElement(parseString(xpp));
5561    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("month")) {
5562      res.setMonthElement(parseString(xpp));
5563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("day")) {
5564      res.setDayElement(parseString(xpp));
5565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("season")) {
5566      res.setSeasonElement(parseString(xpp));
5567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5568      res.setTextElement(parseString(xpp));
5569    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5570      return false;
5571    }
5572    return true;
5573  }
5574
5575  protected Citation.CitationCitedArtifactWebLocationComponent parseCitationCitedArtifactWebLocationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5576    Citation.CitationCitedArtifactWebLocationComponent res = new Citation.CitationCitedArtifactWebLocationComponent();
5577    parseElementAttributes(xpp, res);
5578    next(xpp);
5579    int eventType = nextNoWhitespace(xpp);
5580    while (eventType != XmlPullParser.END_TAG) {
5581    if (!parseCitationCitedArtifactWebLocationComponentContent(eventType, xpp, res))
5582        unknownContent(xpp);
5583      eventType = nextNoWhitespace(xpp);
5584    }
5585    next(xpp);
5586    parseElementClose(res);
5587    return res;
5588  }
5589
5590  protected boolean parseCitationCitedArtifactWebLocationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactWebLocationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5591    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5592      res.getClassifier().add(parseCodeableConcept(xpp));
5593    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5594      res.setUrlElement(parseUri(xpp));
5595    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5596      return false;
5597    }
5598    return true;
5599  }
5600
5601  protected Citation.CitationCitedArtifactClassificationComponent parseCitationCitedArtifactClassificationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5602    Citation.CitationCitedArtifactClassificationComponent res = new Citation.CitationCitedArtifactClassificationComponent();
5603    parseElementAttributes(xpp, res);
5604    next(xpp);
5605    int eventType = nextNoWhitespace(xpp);
5606    while (eventType != XmlPullParser.END_TAG) {
5607    if (!parseCitationCitedArtifactClassificationComponentContent(eventType, xpp, res))
5608        unknownContent(xpp);
5609      eventType = nextNoWhitespace(xpp);
5610    }
5611    next(xpp);
5612    parseElementClose(res);
5613    return res;
5614  }
5615
5616  protected boolean parseCitationCitedArtifactClassificationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactClassificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5617    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5618      res.setType(parseCodeableConcept(xpp));
5619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5620      res.getClassifier().add(parseCodeableConcept(xpp));
5621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whoClassified")) {
5622      res.setWhoClassified(parseCitationCitedArtifactClassificationWhoClassifiedComponent(xpp));
5623    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5624      return false;
5625    }
5626    return true;
5627  }
5628
5629  protected Citation.CitationCitedArtifactClassificationWhoClassifiedComponent parseCitationCitedArtifactClassificationWhoClassifiedComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5630    Citation.CitationCitedArtifactClassificationWhoClassifiedComponent res = new Citation.CitationCitedArtifactClassificationWhoClassifiedComponent();
5631    parseElementAttributes(xpp, res);
5632    next(xpp);
5633    int eventType = nextNoWhitespace(xpp);
5634    while (eventType != XmlPullParser.END_TAG) {
5635    if (!parseCitationCitedArtifactClassificationWhoClassifiedComponentContent(eventType, xpp, res))
5636        unknownContent(xpp);
5637      eventType = nextNoWhitespace(xpp);
5638    }
5639    next(xpp);
5640    parseElementClose(res);
5641    return res;
5642  }
5643
5644  protected boolean parseCitationCitedArtifactClassificationWhoClassifiedComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactClassificationWhoClassifiedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5645    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("person")) {
5646      res.setPerson(parseReference(xpp));
5647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
5648      res.setOrganization(parseReference(xpp));
5649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5650      res.setPublisher(parseReference(xpp));
5651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifierCopyright")) {
5652      res.setClassifierCopyrightElement(parseString(xpp));
5653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("freeToShare")) {
5654      res.setFreeToShareElement(parseBoolean(xpp));
5655    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5656      return false;
5657    }
5658    return true;
5659  }
5660
5661  protected Citation.CitationCitedArtifactContributorshipComponent parseCitationCitedArtifactContributorshipComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5662    Citation.CitationCitedArtifactContributorshipComponent res = new Citation.CitationCitedArtifactContributorshipComponent();
5663    parseElementAttributes(xpp, res);
5664    next(xpp);
5665    int eventType = nextNoWhitespace(xpp);
5666    while (eventType != XmlPullParser.END_TAG) {
5667    if (!parseCitationCitedArtifactContributorshipComponentContent(eventType, xpp, res))
5668        unknownContent(xpp);
5669      eventType = nextNoWhitespace(xpp);
5670    }
5671    next(xpp);
5672    parseElementClose(res);
5673    return res;
5674  }
5675
5676  protected boolean parseCitationCitedArtifactContributorshipComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5677    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("complete")) {
5678      res.setCompleteElement(parseBoolean(xpp));
5679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
5680      res.getEntry().add(parseCitationCitedArtifactContributorshipEntryComponent(xpp));
5681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5682      res.getSummary().add(parseCitationCitedArtifactContributorshipSummaryComponent(xpp));
5683    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5684      return false;
5685    }
5686    return true;
5687  }
5688
5689  protected Citation.CitationCitedArtifactContributorshipEntryComponent parseCitationCitedArtifactContributorshipEntryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5690    Citation.CitationCitedArtifactContributorshipEntryComponent res = new Citation.CitationCitedArtifactContributorshipEntryComponent();
5691    parseElementAttributes(xpp, res);
5692    next(xpp);
5693    int eventType = nextNoWhitespace(xpp);
5694    while (eventType != XmlPullParser.END_TAG) {
5695    if (!parseCitationCitedArtifactContributorshipEntryComponentContent(eventType, xpp, res))
5696        unknownContent(xpp);
5697      eventType = nextNoWhitespace(xpp);
5698    }
5699    next(xpp);
5700    parseElementClose(res);
5701    return res;
5702  }
5703
5704  protected boolean parseCitationCitedArtifactContributorshipEntryComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5705    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5706      res.setName(parseHumanName(xpp));
5707    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("initials")) {
5708      res.setInitialsElement(parseString(xpp));
5709    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collectiveName")) {
5710      res.setCollectiveNameElement(parseString(xpp));
5711    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5712      res.getIdentifier().add(parseIdentifier(xpp));
5713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("affiliationInfo")) {
5714      res.getAffiliationInfo().add(parseCitationCitedArtifactContributorshipEntryAffiliationInfoComponent(xpp));
5715    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
5716      res.getAddress().add(parseAddress(xpp));
5717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
5718      res.getTelecom().add(parseContactPoint(xpp));
5719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributionType")) {
5720      res.getContributionType().add(parseCodeableConcept(xpp));
5721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5722      res.setRole(parseCodeableConcept(xpp));
5723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributionInstance")) {
5724      res.getContributionInstance().add(parseCitationCitedArtifactContributorshipEntryContributionInstanceComponent(xpp));
5725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("correspondingContact")) {
5726      res.setCorrespondingContactElement(parseBoolean(xpp));
5727    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rankingOrder")) {
5728      res.setRankingOrderElement(parsePositiveInt(xpp));
5729    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5730      return false;
5731    }
5732    return true;
5733  }
5734
5735  protected Citation.CitationCitedArtifactContributorshipEntryAffiliationInfoComponent parseCitationCitedArtifactContributorshipEntryAffiliationInfoComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5736    Citation.CitationCitedArtifactContributorshipEntryAffiliationInfoComponent res = new Citation.CitationCitedArtifactContributorshipEntryAffiliationInfoComponent();
5737    parseElementAttributes(xpp, res);
5738    next(xpp);
5739    int eventType = nextNoWhitespace(xpp);
5740    while (eventType != XmlPullParser.END_TAG) {
5741    if (!parseCitationCitedArtifactContributorshipEntryAffiliationInfoComponentContent(eventType, xpp, res))
5742        unknownContent(xpp);
5743      eventType = nextNoWhitespace(xpp);
5744    }
5745    next(xpp);
5746    parseElementClose(res);
5747    return res;
5748  }
5749
5750  protected boolean parseCitationCitedArtifactContributorshipEntryAffiliationInfoComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipEntryAffiliationInfoComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5751    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("affiliation")) {
5752      res.setAffiliationElement(parseString(xpp));
5753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5754      res.setRoleElement(parseString(xpp));
5755    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5756      res.getIdentifier().add(parseIdentifier(xpp));
5757    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5758      return false;
5759    }
5760    return true;
5761  }
5762
5763  protected Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent parseCitationCitedArtifactContributorshipEntryContributionInstanceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5764    Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent res = new Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
5765    parseElementAttributes(xpp, res);
5766    next(xpp);
5767    int eventType = nextNoWhitespace(xpp);
5768    while (eventType != XmlPullParser.END_TAG) {
5769    if (!parseCitationCitedArtifactContributorshipEntryContributionInstanceComponentContent(eventType, xpp, res))
5770        unknownContent(xpp);
5771      eventType = nextNoWhitespace(xpp);
5772    }
5773    next(xpp);
5774    parseElementClose(res);
5775    return res;
5776  }
5777
5778  protected boolean parseCitationCitedArtifactContributorshipEntryContributionInstanceComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5779    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5780      res.setType(parseCodeableConcept(xpp));
5781    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
5782      res.setTimeElement(parseDateTime(xpp));
5783    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5784      return false;
5785    }
5786    return true;
5787  }
5788
5789  protected Citation.CitationCitedArtifactContributorshipSummaryComponent parseCitationCitedArtifactContributorshipSummaryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5790    Citation.CitationCitedArtifactContributorshipSummaryComponent res = new Citation.CitationCitedArtifactContributorshipSummaryComponent();
5791    parseElementAttributes(xpp, res);
5792    next(xpp);
5793    int eventType = nextNoWhitespace(xpp);
5794    while (eventType != XmlPullParser.END_TAG) {
5795    if (!parseCitationCitedArtifactContributorshipSummaryComponentContent(eventType, xpp, res))
5796        unknownContent(xpp);
5797      eventType = nextNoWhitespace(xpp);
5798    }
5799    next(xpp);
5800    parseElementClose(res);
5801    return res;
5802  }
5803
5804  protected boolean parseCitationCitedArtifactContributorshipSummaryComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipSummaryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5805    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5806      res.setType(parseCodeableConcept(xpp));
5807    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("style")) {
5808      res.setStyle(parseCodeableConcept(xpp));
5809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
5810      res.setSource(parseCodeableConcept(xpp));
5811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
5812      res.setValueElement(parseMarkdown(xpp));
5813    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5814      return false;
5815    }
5816    return true;
5817  }
5818
5819  protected Claim parseClaim(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5820    Claim res = new Claim();
5821    parseResourceAttributes(xpp, res);
5822    next(xpp);
5823    int eventType = nextNoWhitespace(xpp);
5824    while (eventType != XmlPullParser.END_TAG) {
5825    if (!parseClaimContent(eventType, xpp, res))
5826        unknownContent(xpp);
5827      eventType = nextNoWhitespace(xpp);
5828    }
5829    next(xpp);
5830    parseElementClose(res);
5831    return res;
5832  }
5833
5834  protected boolean parseClaimContent(int eventType, XmlPullParser xpp, Claim res) throws XmlPullParserException, IOException, FHIRFormatError {
5835    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5836      res.getIdentifier().add(parseIdentifier(xpp));
5837    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5838      res.setStatusElement(parseEnumeration(xpp, Enumerations.FinancialResourceStatusCodes.NULL, new Enumerations.FinancialResourceStatusCodesEnumFactory()));
5839    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5840      res.setType(parseCodeableConcept(xpp));
5841    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5842      res.setSubType(parseCodeableConcept(xpp));
5843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
5844      res.setUseElement(parseEnumeration(xpp, Enumerations.Use.NULL, new Enumerations.UseEnumFactory()));
5845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
5846      res.setPatient(parseReference(xpp));
5847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
5848      res.setBillablePeriod(parsePeriod(xpp));
5849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
5850      res.setCreatedElement(parseDateTime(xpp));
5851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
5852      res.setEnterer(parseReference(xpp));
5853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
5854      res.setInsurer(parseReference(xpp));
5855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
5856      res.setProvider(parseReference(xpp));
5857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
5858      res.setPriority(parseCodeableConcept(xpp));
5859    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
5860      res.setFundsReserve(parseCodeableConcept(xpp));
5861    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
5862      res.getRelated().add(parseClaimRelatedClaimComponent(xpp));
5863    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
5864      res.setPrescription(parseReference(xpp));
5865    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
5866      res.setOriginalPrescription(parseReference(xpp));
5867    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
5868      res.setPayee(parseClaimPayeeComponent(xpp));
5869    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
5870      res.setReferral(parseReference(xpp));
5871    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
5872      res.setFacility(parseReference(xpp));
5873    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
5874      res.getCareTeam().add(parseClaimCareTeamComponent(xpp));
5875    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
5876      res.getSupportingInfo().add(parseClaimSupportingInformationComponent(xpp));
5877    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
5878      res.getDiagnosis().add(parseClaimDiagnosisComponent(xpp));
5879    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
5880      res.getProcedure().add(parseClaimProcedureComponent(xpp));
5881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
5882      res.getInsurance().add(parseClaimInsuranceComponent(xpp));
5883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
5884      res.setAccident(parseClaimAccidentComponent(xpp));
5885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
5886      res.getItem().add(parseClaimItemComponent(xpp));
5887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
5888      res.setTotal(parseMoney(xpp));
5889    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
5890      return false;
5891    }
5892    return true;
5893  }
5894
5895  protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5896    Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent();
5897    parseElementAttributes(xpp, res);
5898    next(xpp);
5899    int eventType = nextNoWhitespace(xpp);
5900    while (eventType != XmlPullParser.END_TAG) {
5901    if (!parseClaimRelatedClaimComponentContent(eventType, xpp, res))
5902        unknownContent(xpp);
5903      eventType = nextNoWhitespace(xpp);
5904    }
5905    next(xpp);
5906    parseElementClose(res);
5907    return res;
5908  }
5909
5910  protected boolean parseClaimRelatedClaimComponentContent(int eventType, XmlPullParser xpp, Claim.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5911    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
5912      res.setClaim(parseReference(xpp));
5913    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
5914      res.setRelationship(parseCodeableConcept(xpp));
5915    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5916      res.setReference(parseIdentifier(xpp));
5917    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5918      return false;
5919    }
5920    return true;
5921  }
5922
5923  protected Claim.PayeeComponent parseClaimPayeeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5924    Claim.PayeeComponent res = new Claim.PayeeComponent();
5925    parseElementAttributes(xpp, res);
5926    next(xpp);
5927    int eventType = nextNoWhitespace(xpp);
5928    while (eventType != XmlPullParser.END_TAG) {
5929    if (!parseClaimPayeeComponentContent(eventType, xpp, res))
5930        unknownContent(xpp);
5931      eventType = nextNoWhitespace(xpp);
5932    }
5933    next(xpp);
5934    parseElementClose(res);
5935    return res;
5936  }
5937
5938  protected boolean parseClaimPayeeComponentContent(int eventType, XmlPullParser xpp, Claim.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5939    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5940      res.setType(parseCodeableConcept(xpp));
5941    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5942      res.setParty(parseReference(xpp));
5943    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5944      return false;
5945    }
5946    return true;
5947  }
5948
5949  protected Claim.CareTeamComponent parseClaimCareTeamComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5950    Claim.CareTeamComponent res = new Claim.CareTeamComponent();
5951    parseElementAttributes(xpp, res);
5952    next(xpp);
5953    int eventType = nextNoWhitespace(xpp);
5954    while (eventType != XmlPullParser.END_TAG) {
5955    if (!parseClaimCareTeamComponentContent(eventType, xpp, res))
5956        unknownContent(xpp);
5957      eventType = nextNoWhitespace(xpp);
5958    }
5959    next(xpp);
5960    parseElementClose(res);
5961    return res;
5962  }
5963
5964  protected boolean parseClaimCareTeamComponentContent(int eventType, XmlPullParser xpp, Claim.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5965    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
5966      res.setSequenceElement(parsePositiveInt(xpp));
5967    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
5968      res.setProvider(parseReference(xpp));
5969    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
5970      res.setResponsibleElement(parseBoolean(xpp));
5971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5972      res.setRole(parseCodeableConcept(xpp));
5973    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
5974      res.setQualification(parseCodeableConcept(xpp));
5975    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5976      return false;
5977    }
5978    return true;
5979  }
5980
5981  protected Claim.SupportingInformationComponent parseClaimSupportingInformationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5982    Claim.SupportingInformationComponent res = new Claim.SupportingInformationComponent();
5983    parseElementAttributes(xpp, res);
5984    next(xpp);
5985    int eventType = nextNoWhitespace(xpp);
5986    while (eventType != XmlPullParser.END_TAG) {
5987    if (!parseClaimSupportingInformationComponentContent(eventType, xpp, res))
5988        unknownContent(xpp);
5989      eventType = nextNoWhitespace(xpp);
5990    }
5991    next(xpp);
5992    parseElementClose(res);
5993    return res;
5994  }
5995
5996  protected boolean parseClaimSupportingInformationComponentContent(int eventType, XmlPullParser xpp, Claim.SupportingInformationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5997    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
5998      res.setSequenceElement(parsePositiveInt(xpp));
5999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6000      res.setCategory(parseCodeableConcept(xpp));
6001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6002      res.setCode(parseCodeableConcept(xpp));
6003    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
6004      res.setTiming(parseType("timing", xpp));
6005    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
6006      res.setValue(parseType("value", xpp));
6007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
6008      res.setReason(parseCodeableConcept(xpp));
6009    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6010      return false;
6011    }
6012    return true;
6013  }
6014
6015  protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6016    Claim.DiagnosisComponent res = new Claim.DiagnosisComponent();
6017    parseElementAttributes(xpp, res);
6018    next(xpp);
6019    int eventType = nextNoWhitespace(xpp);
6020    while (eventType != XmlPullParser.END_TAG) {
6021    if (!parseClaimDiagnosisComponentContent(eventType, xpp, res))
6022        unknownContent(xpp);
6023      eventType = nextNoWhitespace(xpp);
6024    }
6025    next(xpp);
6026    parseElementClose(res);
6027    return res;
6028  }
6029
6030  protected boolean parseClaimDiagnosisComponentContent(int eventType, XmlPullParser xpp, Claim.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6031    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6032      res.setSequenceElement(parsePositiveInt(xpp));
6033    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
6034      res.setDiagnosis(parseType("diagnosis", xpp));
6035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6036      res.getType().add(parseCodeableConcept(xpp));
6037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onAdmission")) {
6038      res.setOnAdmission(parseCodeableConcept(xpp));
6039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
6040      res.setPackageCode(parseCodeableConcept(xpp));
6041    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6042      return false;
6043    }
6044    return true;
6045  }
6046
6047  protected Claim.ProcedureComponent parseClaimProcedureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6048    Claim.ProcedureComponent res = new Claim.ProcedureComponent();
6049    parseElementAttributes(xpp, res);
6050    next(xpp);
6051    int eventType = nextNoWhitespace(xpp);
6052    while (eventType != XmlPullParser.END_TAG) {
6053    if (!parseClaimProcedureComponentContent(eventType, xpp, res))
6054        unknownContent(xpp);
6055      eventType = nextNoWhitespace(xpp);
6056    }
6057    next(xpp);
6058    parseElementClose(res);
6059    return res;
6060  }
6061
6062  protected boolean parseClaimProcedureComponentContent(int eventType, XmlPullParser xpp, Claim.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6063    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6064      res.setSequenceElement(parsePositiveInt(xpp));
6065    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6066      res.getType().add(parseCodeableConcept(xpp));
6067    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6068      res.setDateElement(parseDateTime(xpp));
6069    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
6070      res.setProcedure(parseType("procedure", xpp));
6071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6072      res.getUdi().add(parseReference(xpp));
6073    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6074      return false;
6075    }
6076    return true;
6077  }
6078
6079  protected Claim.InsuranceComponent parseClaimInsuranceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6080    Claim.InsuranceComponent res = new Claim.InsuranceComponent();
6081    parseElementAttributes(xpp, res);
6082    next(xpp);
6083    int eventType = nextNoWhitespace(xpp);
6084    while (eventType != XmlPullParser.END_TAG) {
6085    if (!parseClaimInsuranceComponentContent(eventType, xpp, res))
6086        unknownContent(xpp);
6087      eventType = nextNoWhitespace(xpp);
6088    }
6089    next(xpp);
6090    parseElementClose(res);
6091    return res;
6092  }
6093
6094  protected boolean parseClaimInsuranceComponentContent(int eventType, XmlPullParser xpp, Claim.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6095    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6096      res.setSequenceElement(parsePositiveInt(xpp));
6097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
6098      res.setFocalElement(parseBoolean(xpp));
6099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6100      res.setIdentifier(parseIdentifier(xpp));
6101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
6102      res.setCoverage(parseReference(xpp));
6103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
6104      res.setBusinessArrangementElement(parseString(xpp));
6105    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
6106      res.getPreAuthRef().add(parseString(xpp));
6107    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
6108      res.setClaimResponse(parseReference(xpp));
6109    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6110      return false;
6111    }
6112    return true;
6113  }
6114
6115  protected Claim.AccidentComponent parseClaimAccidentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6116    Claim.AccidentComponent res = new Claim.AccidentComponent();
6117    parseElementAttributes(xpp, res);
6118    next(xpp);
6119    int eventType = nextNoWhitespace(xpp);
6120    while (eventType != XmlPullParser.END_TAG) {
6121    if (!parseClaimAccidentComponentContent(eventType, xpp, res))
6122        unknownContent(xpp);
6123      eventType = nextNoWhitespace(xpp);
6124    }
6125    next(xpp);
6126    parseElementClose(res);
6127    return res;
6128  }
6129
6130  protected boolean parseClaimAccidentComponentContent(int eventType, XmlPullParser xpp, Claim.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6131    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6132      res.setDateElement(parseDate(xpp));
6133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6134      res.setType(parseCodeableConcept(xpp));
6135    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6136      res.setLocation(parseType("location", xpp));
6137    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6138      return false;
6139    }
6140    return true;
6141  }
6142
6143  protected Claim.ItemComponent parseClaimItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6144    Claim.ItemComponent res = new Claim.ItemComponent();
6145    parseElementAttributes(xpp, res);
6146    next(xpp);
6147    int eventType = nextNoWhitespace(xpp);
6148    while (eventType != XmlPullParser.END_TAG) {
6149    if (!parseClaimItemComponentContent(eventType, xpp, res))
6150        unknownContent(xpp);
6151      eventType = nextNoWhitespace(xpp);
6152    }
6153    next(xpp);
6154    parseElementClose(res);
6155    return res;
6156  }
6157
6158  protected boolean parseClaimItemComponentContent(int eventType, XmlPullParser xpp, Claim.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6159    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6160      res.setSequenceElement(parsePositiveInt(xpp));
6161    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamSequence")) {
6162      res.getCareTeamSequence().add(parsePositiveInt(xpp));
6163    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisSequence")) {
6164      res.getDiagnosisSequence().add(parsePositiveInt(xpp));
6165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureSequence")) {
6166      res.getProcedureSequence().add(parsePositiveInt(xpp));
6167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationSequence")) {
6168      res.getInformationSequence().add(parsePositiveInt(xpp));
6169    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6170      res.setRevenue(parseCodeableConcept(xpp));
6171    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6172      res.setCategory(parseCodeableConcept(xpp));
6173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6174      res.setProductOrService(parseCodeableConcept(xpp));
6175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6176      res.getModifier().add(parseCodeableConcept(xpp));
6177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6178      res.getProgramCode().add(parseCodeableConcept(xpp));
6179    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
6180      res.setServiced(parseType("serviced", xpp));
6181    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6182      res.setLocation(parseType("location", xpp));
6183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6184      res.setQuantity(parseQuantity(xpp));
6185    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6186      res.setUnitPrice(parseMoney(xpp));
6187    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6188      res.setFactorElement(parseDecimal(xpp));
6189    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6190      res.setNet(parseMoney(xpp));
6191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6192      res.getUdi().add(parseReference(xpp));
6193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6194      res.setBodySite(parseCodeableConcept(xpp));
6195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
6196      res.getSubSite().add(parseCodeableConcept(xpp));
6197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
6198      res.getEncounter().add(parseReference(xpp));
6199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6200      res.getDetail().add(parseClaimDetailComponent(xpp));
6201    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6202      return false;
6203    }
6204    return true;
6205  }
6206
6207  protected Claim.DetailComponent parseClaimDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6208    Claim.DetailComponent res = new Claim.DetailComponent();
6209    parseElementAttributes(xpp, res);
6210    next(xpp);
6211    int eventType = nextNoWhitespace(xpp);
6212    while (eventType != XmlPullParser.END_TAG) {
6213    if (!parseClaimDetailComponentContent(eventType, xpp, res))
6214        unknownContent(xpp);
6215      eventType = nextNoWhitespace(xpp);
6216    }
6217    next(xpp);
6218    parseElementClose(res);
6219    return res;
6220  }
6221
6222  protected boolean parseClaimDetailComponentContent(int eventType, XmlPullParser xpp, Claim.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6223    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6224      res.setSequenceElement(parsePositiveInt(xpp));
6225    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6226      res.setRevenue(parseCodeableConcept(xpp));
6227    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6228      res.setCategory(parseCodeableConcept(xpp));
6229    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6230      res.setProductOrService(parseCodeableConcept(xpp));
6231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6232      res.getModifier().add(parseCodeableConcept(xpp));
6233    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6234      res.getProgramCode().add(parseCodeableConcept(xpp));
6235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6236      res.setQuantity(parseQuantity(xpp));
6237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6238      res.setUnitPrice(parseMoney(xpp));
6239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6240      res.setFactorElement(parseDecimal(xpp));
6241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6242      res.setNet(parseMoney(xpp));
6243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6244      res.getUdi().add(parseReference(xpp));
6245    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6246      res.getSubDetail().add(parseClaimSubDetailComponent(xpp));
6247    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6248      return false;
6249    }
6250    return true;
6251  }
6252
6253  protected Claim.SubDetailComponent parseClaimSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6254    Claim.SubDetailComponent res = new Claim.SubDetailComponent();
6255    parseElementAttributes(xpp, res);
6256    next(xpp);
6257    int eventType = nextNoWhitespace(xpp);
6258    while (eventType != XmlPullParser.END_TAG) {
6259    if (!parseClaimSubDetailComponentContent(eventType, xpp, res))
6260        unknownContent(xpp);
6261      eventType = nextNoWhitespace(xpp);
6262    }
6263    next(xpp);
6264    parseElementClose(res);
6265    return res;
6266  }
6267
6268  protected boolean parseClaimSubDetailComponentContent(int eventType, XmlPullParser xpp, Claim.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6269    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6270      res.setSequenceElement(parsePositiveInt(xpp));
6271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6272      res.setRevenue(parseCodeableConcept(xpp));
6273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6274      res.setCategory(parseCodeableConcept(xpp));
6275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6276      res.setProductOrService(parseCodeableConcept(xpp));
6277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6278      res.getModifier().add(parseCodeableConcept(xpp));
6279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6280      res.getProgramCode().add(parseCodeableConcept(xpp));
6281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6282      res.setQuantity(parseQuantity(xpp));
6283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6284      res.setUnitPrice(parseMoney(xpp));
6285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6286      res.setFactorElement(parseDecimal(xpp));
6287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6288      res.setNet(parseMoney(xpp));
6289    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6290      res.getUdi().add(parseReference(xpp));
6291    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6292      return false;
6293    }
6294    return true;
6295  }
6296
6297  protected ClaimResponse parseClaimResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6298    ClaimResponse res = new ClaimResponse();
6299    parseResourceAttributes(xpp, res);
6300    next(xpp);
6301    int eventType = nextNoWhitespace(xpp);
6302    while (eventType != XmlPullParser.END_TAG) {
6303    if (!parseClaimResponseContent(eventType, xpp, res))
6304        unknownContent(xpp);
6305      eventType = nextNoWhitespace(xpp);
6306    }
6307    next(xpp);
6308    parseElementClose(res);
6309    return res;
6310  }
6311
6312  protected boolean parseClaimResponseContent(int eventType, XmlPullParser xpp, ClaimResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
6313    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6314      res.getIdentifier().add(parseIdentifier(xpp));
6315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6316      res.setStatusElement(parseEnumeration(xpp, Enumerations.FinancialResourceStatusCodes.NULL, new Enumerations.FinancialResourceStatusCodesEnumFactory()));
6317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6318      res.setType(parseCodeableConcept(xpp));
6319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
6320      res.setSubType(parseCodeableConcept(xpp));
6321    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
6322      res.setUseElement(parseEnumeration(xpp, Enumerations.Use.NULL, new Enumerations.UseEnumFactory()));
6323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6324      res.setPatient(parseReference(xpp));
6325    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6326      res.setCreatedElement(parseDateTime(xpp));
6327    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
6328      res.setInsurer(parseReference(xpp));
6329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
6330      res.setRequestor(parseReference(xpp));
6331    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
6332      res.setRequest(parseReference(xpp));
6333    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
6334      res.setOutcomeElement(parseEnumeration(xpp, Enumerations.ClaimProcessingCodes.NULL, new Enumerations.ClaimProcessingCodesEnumFactory()));
6335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
6336      res.setDispositionElement(parseString(xpp));
6337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
6338      res.setPreAuthRefElement(parseString(xpp));
6339    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthPeriod")) {
6340      res.setPreAuthPeriod(parsePeriod(xpp));
6341    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payeeType")) {
6342      res.setPayeeType(parseCodeableConcept(xpp));
6343    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
6344      res.getItem().add(parseClaimResponseItemComponent(xpp));
6345    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
6346      res.getAddItem().add(parseClaimResponseAddedItemComponent(xpp));
6347    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6348      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6349    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
6350      res.getTotal().add(parseClaimResponseTotalComponent(xpp));
6351    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
6352      res.setPayment(parseClaimResponsePaymentComponent(xpp));
6353    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
6354      res.setFundsReserve(parseCodeableConcept(xpp));
6355    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("formCode")) {
6356      res.setFormCode(parseCodeableConcept(xpp));
6357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
6358      res.setForm(parseAttachment(xpp));
6359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
6360      res.getProcessNote().add(parseClaimResponseNoteComponent(xpp));
6361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
6362      res.getCommunicationRequest().add(parseReference(xpp));
6363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
6364      res.getInsurance().add(parseClaimResponseInsuranceComponent(xpp));
6365    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
6366      res.getError().add(parseClaimResponseErrorComponent(xpp));
6367    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
6368      return false;
6369    }
6370    return true;
6371  }
6372
6373  protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6374    ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent();
6375    parseElementAttributes(xpp, res);
6376    next(xpp);
6377    int eventType = nextNoWhitespace(xpp);
6378    while (eventType != XmlPullParser.END_TAG) {
6379    if (!parseClaimResponseItemComponentContent(eventType, xpp, res))
6380        unknownContent(xpp);
6381      eventType = nextNoWhitespace(xpp);
6382    }
6383    next(xpp);
6384    parseElementClose(res);
6385    return res;
6386  }
6387
6388  protected boolean parseClaimResponseItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6389    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
6390      res.setItemSequenceElement(parsePositiveInt(xpp));
6391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6392      res.getNoteNumber().add(parsePositiveInt(xpp));
6393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6394      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6396      res.getDetail().add(parseClaimResponseItemDetailComponent(xpp));
6397    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6398      return false;
6399    }
6400    return true;
6401  }
6402
6403  protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6404    ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent();
6405    parseElementAttributes(xpp, res);
6406    next(xpp);
6407    int eventType = nextNoWhitespace(xpp);
6408    while (eventType != XmlPullParser.END_TAG) {
6409    if (!parseClaimResponseAdjudicationComponentContent(eventType, xpp, res))
6410        unknownContent(xpp);
6411      eventType = nextNoWhitespace(xpp);
6412    }
6413    next(xpp);
6414    parseElementClose(res);
6415    return res;
6416  }
6417
6418  protected boolean parseClaimResponseAdjudicationComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6419    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6420      res.setCategory(parseCodeableConcept(xpp));
6421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
6422      res.setReason(parseCodeableConcept(xpp));
6423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
6424      res.setAmount(parseMoney(xpp));
6425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
6426      res.setValueElement(parseDecimal(xpp));
6427    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6428      return false;
6429    }
6430    return true;
6431  }
6432
6433  protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6434    ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent();
6435    parseElementAttributes(xpp, res);
6436    next(xpp);
6437    int eventType = nextNoWhitespace(xpp);
6438    while (eventType != XmlPullParser.END_TAG) {
6439    if (!parseClaimResponseItemDetailComponentContent(eventType, xpp, res))
6440        unknownContent(xpp);
6441      eventType = nextNoWhitespace(xpp);
6442    }
6443    next(xpp);
6444    parseElementClose(res);
6445    return res;
6446  }
6447
6448  protected boolean parseClaimResponseItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6449    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
6450      res.setDetailSequenceElement(parsePositiveInt(xpp));
6451    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6452      res.getNoteNumber().add(parsePositiveInt(xpp));
6453    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6454      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6456      res.getSubDetail().add(parseClaimResponseSubDetailComponent(xpp));
6457    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6458      return false;
6459    }
6460    return true;
6461  }
6462
6463  protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6464    ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent();
6465    parseElementAttributes(xpp, res);
6466    next(xpp);
6467    int eventType = nextNoWhitespace(xpp);
6468    while (eventType != XmlPullParser.END_TAG) {
6469    if (!parseClaimResponseSubDetailComponentContent(eventType, xpp, res))
6470        unknownContent(xpp);
6471      eventType = nextNoWhitespace(xpp);
6472    }
6473    next(xpp);
6474    parseElementClose(res);
6475    return res;
6476  }
6477
6478  protected boolean parseClaimResponseSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6479    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetailSequence")) {
6480      res.setSubDetailSequenceElement(parsePositiveInt(xpp));
6481    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6482      res.getNoteNumber().add(parsePositiveInt(xpp));
6483    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6484      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6485    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6486      return false;
6487    }
6488    return true;
6489  }
6490
6491  protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6492    ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent();
6493    parseElementAttributes(xpp, res);
6494    next(xpp);
6495    int eventType = nextNoWhitespace(xpp);
6496    while (eventType != XmlPullParser.END_TAG) {
6497    if (!parseClaimResponseAddedItemComponentContent(eventType, xpp, res))
6498        unknownContent(xpp);
6499      eventType = nextNoWhitespace(xpp);
6500    }
6501    next(xpp);
6502    parseElementClose(res);
6503    return res;
6504  }
6505
6506  protected boolean parseClaimResponseAddedItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6507    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
6508      res.getItemSequence().add(parsePositiveInt(xpp));
6509    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
6510      res.getDetailSequence().add(parsePositiveInt(xpp));
6511    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subdetailSequence")) {
6512      res.getSubdetailSequence().add(parsePositiveInt(xpp));
6513    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
6514      res.getProvider().add(parseReference(xpp));
6515    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6516      res.setProductOrService(parseCodeableConcept(xpp));
6517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6518      res.getModifier().add(parseCodeableConcept(xpp));
6519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6520      res.getProgramCode().add(parseCodeableConcept(xpp));
6521    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
6522      res.setServiced(parseType("serviced", xpp));
6523    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6524      res.setLocation(parseType("location", xpp));
6525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6526      res.setQuantity(parseQuantity(xpp));
6527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6528      res.setUnitPrice(parseMoney(xpp));
6529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6530      res.setFactorElement(parseDecimal(xpp));
6531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6532      res.setNet(parseMoney(xpp));
6533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6534      res.setBodySite(parseCodeableConcept(xpp));
6535    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
6536      res.getSubSite().add(parseCodeableConcept(xpp));
6537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6538      res.getNoteNumber().add(parsePositiveInt(xpp));
6539    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6540      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6541    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6542      res.getDetail().add(parseClaimResponseAddedItemDetailComponent(xpp));
6543    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6544      return false;
6545    }
6546    return true;
6547  }
6548
6549  protected ClaimResponse.AddedItemDetailComponent parseClaimResponseAddedItemDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6550    ClaimResponse.AddedItemDetailComponent res = new ClaimResponse.AddedItemDetailComponent();
6551    parseElementAttributes(xpp, res);
6552    next(xpp);
6553    int eventType = nextNoWhitespace(xpp);
6554    while (eventType != XmlPullParser.END_TAG) {
6555    if (!parseClaimResponseAddedItemDetailComponentContent(eventType, xpp, res))
6556        unknownContent(xpp);
6557      eventType = nextNoWhitespace(xpp);
6558    }
6559    next(xpp);
6560    parseElementClose(res);
6561    return res;
6562  }
6563
6564  protected boolean parseClaimResponseAddedItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6565    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6566      res.setProductOrService(parseCodeableConcept(xpp));
6567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6568      res.getModifier().add(parseCodeableConcept(xpp));
6569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6570      res.setQuantity(parseQuantity(xpp));
6571    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6572      res.setUnitPrice(parseMoney(xpp));
6573    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6574      res.setFactorElement(parseDecimal(xpp));
6575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6576      res.setNet(parseMoney(xpp));
6577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6578      res.getNoteNumber().add(parsePositiveInt(xpp));
6579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6580      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6581    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6582      res.getSubDetail().add(parseClaimResponseAddedItemSubDetailComponent(xpp));
6583    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6584      return false;
6585    }
6586    return true;
6587  }
6588
6589  protected ClaimResponse.AddedItemSubDetailComponent parseClaimResponseAddedItemSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6590    ClaimResponse.AddedItemSubDetailComponent res = new ClaimResponse.AddedItemSubDetailComponent();
6591    parseElementAttributes(xpp, res);
6592    next(xpp);
6593    int eventType = nextNoWhitespace(xpp);
6594    while (eventType != XmlPullParser.END_TAG) {
6595    if (!parseClaimResponseAddedItemSubDetailComponentContent(eventType, xpp, res))
6596        unknownContent(xpp);
6597      eventType = nextNoWhitespace(xpp);
6598    }
6599    next(xpp);
6600    parseElementClose(res);
6601    return res;
6602  }
6603
6604  protected boolean parseClaimResponseAddedItemSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemSubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6605    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6606      res.setProductOrService(parseCodeableConcept(xpp));
6607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6608      res.getModifier().add(parseCodeableConcept(xpp));
6609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6610      res.setQuantity(parseQuantity(xpp));
6611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6612      res.setUnitPrice(parseMoney(xpp));
6613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6614      res.setFactorElement(parseDecimal(xpp));
6615    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6616      res.setNet(parseMoney(xpp));
6617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6618      res.getNoteNumber().add(parsePositiveInt(xpp));
6619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6620      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6621    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6622      return false;
6623    }
6624    return true;
6625  }
6626
6627  protected ClaimResponse.TotalComponent parseClaimResponseTotalComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6628    ClaimResponse.TotalComponent res = new ClaimResponse.TotalComponent();
6629    parseElementAttributes(xpp, res);
6630    next(xpp);
6631    int eventType = nextNoWhitespace(xpp);
6632    while (eventType != XmlPullParser.END_TAG) {
6633    if (!parseClaimResponseTotalComponentContent(eventType, xpp, res))
6634        unknownContent(xpp);
6635      eventType = nextNoWhitespace(xpp);
6636    }
6637    next(xpp);
6638    parseElementClose(res);
6639    return res;
6640  }
6641
6642  protected boolean parseClaimResponseTotalComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.TotalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6643    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6644      res.setCategory(parseCodeableConcept(xpp));
6645    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
6646      res.setAmount(parseMoney(xpp));
6647    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6648      return false;
6649    }
6650    return true;
6651  }
6652
6653  protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6654    ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent();
6655    parseElementAttributes(xpp, res);
6656    next(xpp);
6657    int eventType = nextNoWhitespace(xpp);
6658    while (eventType != XmlPullParser.END_TAG) {
6659    if (!parseClaimResponsePaymentComponentContent(eventType, xpp, res))
6660        unknownContent(xpp);
6661      eventType = nextNoWhitespace(xpp);
6662    }
6663    next(xpp);
6664    parseElementClose(res);
6665    return res;
6666  }
6667
6668  protected boolean parseClaimResponsePaymentComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6669    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6670      res.setType(parseCodeableConcept(xpp));
6671    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
6672      res.setAdjustment(parseMoney(xpp));
6673    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
6674      res.setAdjustmentReason(parseCodeableConcept(xpp));
6675    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6676      res.setDateElement(parseDate(xpp));
6677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
6678      res.setAmount(parseMoney(xpp));
6679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6680      res.setIdentifier(parseIdentifier(xpp));
6681    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6682      return false;
6683    }
6684    return true;
6685  }
6686
6687  protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6688    ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent();
6689    parseElementAttributes(xpp, res);
6690    next(xpp);
6691    int eventType = nextNoWhitespace(xpp);
6692    while (eventType != XmlPullParser.END_TAG) {
6693    if (!parseClaimResponseNoteComponentContent(eventType, xpp, res))
6694        unknownContent(xpp);
6695      eventType = nextNoWhitespace(xpp);
6696    }
6697    next(xpp);
6698    parseElementClose(res);
6699    return res;
6700  }
6701
6702  protected boolean parseClaimResponseNoteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6703    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
6704      res.setNumberElement(parsePositiveInt(xpp));
6705    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6706      res.setTypeElement(parseEnumeration(xpp, Enumerations.NoteType.NULL, new Enumerations.NoteTypeEnumFactory()));
6707    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
6708      res.setTextElement(parseString(xpp));
6709    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
6710      res.setLanguage(parseCodeableConcept(xpp));
6711    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6712      return false;
6713    }
6714    return true;
6715  }
6716
6717  protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6718    ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent();
6719    parseElementAttributes(xpp, res);
6720    next(xpp);
6721    int eventType = nextNoWhitespace(xpp);
6722    while (eventType != XmlPullParser.END_TAG) {
6723    if (!parseClaimResponseInsuranceComponentContent(eventType, xpp, res))
6724        unknownContent(xpp);
6725      eventType = nextNoWhitespace(xpp);
6726    }
6727    next(xpp);
6728    parseElementClose(res);
6729    return res;
6730  }
6731
6732  protected boolean parseClaimResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6733    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6734      res.setSequenceElement(parsePositiveInt(xpp));
6735    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
6736      res.setFocalElement(parseBoolean(xpp));
6737    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
6738      res.setCoverage(parseReference(xpp));
6739    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
6740      res.setBusinessArrangementElement(parseString(xpp));
6741    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
6742      res.setClaimResponse(parseReference(xpp));
6743    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6744      return false;
6745    }
6746    return true;
6747  }
6748
6749  protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6750    ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent();
6751    parseElementAttributes(xpp, res);
6752    next(xpp);
6753    int eventType = nextNoWhitespace(xpp);
6754    while (eventType != XmlPullParser.END_TAG) {
6755    if (!parseClaimResponseErrorComponentContent(eventType, xpp, res))
6756        unknownContent(xpp);
6757      eventType = nextNoWhitespace(xpp);
6758    }
6759    next(xpp);
6760    parseElementClose(res);
6761    return res;
6762  }
6763
6764  protected boolean parseClaimResponseErrorComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ErrorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6765    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
6766      res.setItemSequenceElement(parsePositiveInt(xpp));
6767    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
6768      res.setDetailSequenceElement(parsePositiveInt(xpp));
6769    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetailSequence")) {
6770      res.setSubDetailSequenceElement(parsePositiveInt(xpp));
6771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6772      res.setCode(parseCodeableConcept(xpp));
6773    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6774      return false;
6775    }
6776    return true;
6777  }
6778
6779  protected ClinicalImpression parseClinicalImpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6780    ClinicalImpression res = new ClinicalImpression();
6781    parseResourceAttributes(xpp, res);
6782    next(xpp);
6783    int eventType = nextNoWhitespace(xpp);
6784    while (eventType != XmlPullParser.END_TAG) {
6785    if (!parseClinicalImpressionContent(eventType, xpp, res))
6786        unknownContent(xpp);
6787      eventType = nextNoWhitespace(xpp);
6788    }
6789    next(xpp);
6790    parseElementClose(res);
6791    return res;
6792  }
6793
6794  protected boolean parseClinicalImpressionContent(int eventType, XmlPullParser xpp, ClinicalImpression res) throws XmlPullParserException, IOException, FHIRFormatError {
6795    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6796      res.getIdentifier().add(parseIdentifier(xpp));
6797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6798      res.setStatusElement(parseEnumeration(xpp, Enumerations.EventStatus.NULL, new Enumerations.EventStatusEnumFactory()));
6799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
6800      res.setStatusReason(parseCodeableConcept(xpp));
6801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6802      res.setDescriptionElement(parseString(xpp));
6803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6804      res.setSubject(parseReference(xpp));
6805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
6806      res.setEncounter(parseReference(xpp));
6807    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
6808      res.setEffective(parseType("effective", xpp));
6809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6810      res.setDateElement(parseDateTime(xpp));
6811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6812      res.setPerformer(parseReference(xpp));
6813    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previous")) {
6814      res.setPrevious(parseReference(xpp));
6815    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("problem")) {
6816      res.getProblem().add(parseReference(xpp));
6817    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
6818      res.getProtocol().add(parseUri(xpp));
6819    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
6820      res.setSummaryElement(parseString(xpp));
6821    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("finding")) {
6822      res.getFinding().add(parseClinicalImpressionFindingComponent(xpp));
6823    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisCodeableConcept")) {
6824      res.getPrognosisCodeableConcept().add(parseCodeableConcept(xpp));
6825    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisReference")) {
6826      res.getPrognosisReference().add(parseReference(xpp));
6827    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
6828      res.getSupportingInfo().add(parseReference(xpp));
6829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6830      res.getNote().add(parseAnnotation(xpp));
6831    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
6832      return false;
6833    }
6834    return true;
6835  }
6836
6837  protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionFindingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6838    ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent();
6839    parseElementAttributes(xpp, res);
6840    next(xpp);
6841    int eventType = nextNoWhitespace(xpp);
6842    while (eventType != XmlPullParser.END_TAG) {
6843    if (!parseClinicalImpressionFindingComponentContent(eventType, xpp, res))
6844        unknownContent(xpp);
6845      eventType = nextNoWhitespace(xpp);
6846    }
6847    next(xpp);
6848    parseElementClose(res);
6849    return res;
6850  }
6851
6852  protected boolean parseClinicalImpressionFindingComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression.ClinicalImpressionFindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6853    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
6854      res.setItem(parseCodeableReference(xpp));
6855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
6856      res.setBasisElement(parseString(xpp));
6857    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6858      return false;
6859    }
6860    return true;
6861  }
6862
6863  protected ClinicalUseDefinition parseClinicalUseDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6864    ClinicalUseDefinition res = new ClinicalUseDefinition();
6865    parseResourceAttributes(xpp, res);
6866    next(xpp);
6867    int eventType = nextNoWhitespace(xpp);
6868    while (eventType != XmlPullParser.END_TAG) {
6869    if (!parseClinicalUseDefinitionContent(eventType, xpp, res))
6870        unknownContent(xpp);
6871      eventType = nextNoWhitespace(xpp);
6872    }
6873    next(xpp);
6874    parseElementClose(res);
6875    return res;
6876  }
6877
6878  protected boolean parseClinicalUseDefinitionContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
6879    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6880      res.getIdentifier().add(parseIdentifier(xpp));
6881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6882      res.setTypeElement(parseEnumeration(xpp, Enumerations.ClinicalUseIssueType.NULL, new Enumerations.ClinicalUseIssueTypeEnumFactory()));
6883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6884      res.getCategory().add(parseCodeableConcept(xpp));
6885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6886      res.getSubject().add(parseReference(xpp));
6887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6888      res.setStatus(parseCodeableConcept(xpp));
6889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contraindication")) {
6890      res.setContraindication(parseClinicalUseDefinitionContraindicationComponent(xpp));
6891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
6892      res.setIndication(parseClinicalUseDefinitionIndicationComponent(xpp));
6893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
6894      res.setInteraction(parseClinicalUseDefinitionInteractionComponent(xpp));
6895    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
6896      res.getPopulation().add(parseReference(xpp));
6897    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
6898      res.setUndesirableEffect(parseClinicalUseDefinitionUndesirableEffectComponent(xpp));
6899    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("warning")) {
6900      res.setWarning(parseClinicalUseDefinitionWarningComponent(xpp));
6901    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
6902      return false;
6903    }
6904    return true;
6905  }
6906
6907  protected ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent parseClinicalUseDefinitionContraindicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6908    ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent();
6909    parseElementAttributes(xpp, res);
6910    next(xpp);
6911    int eventType = nextNoWhitespace(xpp);
6912    while (eventType != XmlPullParser.END_TAG) {
6913    if (!parseClinicalUseDefinitionContraindicationComponentContent(eventType, xpp, res))
6914        unknownContent(xpp);
6915      eventType = nextNoWhitespace(xpp);
6916    }
6917    next(xpp);
6918    parseElementClose(res);
6919    return res;
6920  }
6921
6922  protected boolean parseClinicalUseDefinitionContraindicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6923    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
6924      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
6925    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
6926      res.setDiseaseStatus(parseCodeableReference(xpp));
6927    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
6928      res.getComorbidity().add(parseCodeableReference(xpp));
6929    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
6930      res.getIndication().add(parseReference(xpp));
6931    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
6932      res.getOtherTherapy().add(parseClinicalUseDefinitionContraindicationOtherTherapyComponent(xpp));
6933    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6934      return false;
6935    }
6936    return true;
6937  }
6938
6939  protected ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent parseClinicalUseDefinitionContraindicationOtherTherapyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6940    ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent();
6941    parseElementAttributes(xpp, res);
6942    next(xpp);
6943    int eventType = nextNoWhitespace(xpp);
6944    while (eventType != XmlPullParser.END_TAG) {
6945    if (!parseClinicalUseDefinitionContraindicationOtherTherapyComponentContent(eventType, xpp, res))
6946        unknownContent(xpp);
6947      eventType = nextNoWhitespace(xpp);
6948    }
6949    next(xpp);
6950    parseElementClose(res);
6951    return res;
6952  }
6953
6954  protected boolean parseClinicalUseDefinitionContraindicationOtherTherapyComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6955    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationshipType")) {
6956      res.setRelationshipType(parseCodeableConcept(xpp));
6957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("therapy")) {
6958      res.setTherapy(parseCodeableReference(xpp));
6959    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6960      return false;
6961    }
6962    return true;
6963  }
6964
6965  protected ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent parseClinicalUseDefinitionIndicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6966    ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent();
6967    parseElementAttributes(xpp, res);
6968    next(xpp);
6969    int eventType = nextNoWhitespace(xpp);
6970    while (eventType != XmlPullParser.END_TAG) {
6971    if (!parseClinicalUseDefinitionIndicationComponentContent(eventType, xpp, res))
6972        unknownContent(xpp);
6973      eventType = nextNoWhitespace(xpp);
6974    }
6975    next(xpp);
6976    parseElementClose(res);
6977    return res;
6978  }
6979
6980  protected boolean parseClinicalUseDefinitionIndicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6981    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
6982      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
6983    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
6984      res.setDiseaseStatus(parseCodeableReference(xpp));
6985    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
6986      res.getComorbidity().add(parseCodeableReference(xpp));
6987    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intendedEffect")) {
6988      res.setIntendedEffect(parseCodeableReference(xpp));
6989    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
6990      res.setDuration(parseQuantity(xpp));
6991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
6992      res.getUndesirableEffect().add(parseReference(xpp));
6993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
6994      res.getOtherTherapy().add(parseClinicalUseDefinitionContraindicationOtherTherapyComponent(xpp));
6995    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6996      return false;
6997    }
6998    return true;
6999  }
7000
7001  protected ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent parseClinicalUseDefinitionInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7002    ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent();
7003    parseElementAttributes(xpp, res);
7004    next(xpp);
7005    int eventType = nextNoWhitespace(xpp);
7006    while (eventType != XmlPullParser.END_TAG) {
7007    if (!parseClinicalUseDefinitionInteractionComponentContent(eventType, xpp, res))
7008        unknownContent(xpp);
7009      eventType = nextNoWhitespace(xpp);
7010    }
7011    next(xpp);
7012    parseElementClose(res);
7013    return res;
7014  }
7015
7016  protected boolean parseClinicalUseDefinitionInteractionComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7017    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interactant")) {
7018      res.getInteractant().add(parseClinicalUseDefinitionInteractionInteractantComponent(xpp));
7019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7020      res.setType(parseCodeableConcept(xpp));
7021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effect")) {
7022      res.setEffect(parseCodeableReference(xpp));
7023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incidence")) {
7024      res.setIncidence(parseCodeableConcept(xpp));
7025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("management")) {
7026      res.getManagement().add(parseCodeableConcept(xpp));
7027    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7028      return false;
7029    }
7030    return true;
7031  }
7032
7033  protected ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent parseClinicalUseDefinitionInteractionInteractantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7034    ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent();
7035    parseElementAttributes(xpp, res);
7036    next(xpp);
7037    int eventType = nextNoWhitespace(xpp);
7038    while (eventType != XmlPullParser.END_TAG) {
7039    if (!parseClinicalUseDefinitionInteractionInteractantComponentContent(eventType, xpp, res))
7040        unknownContent(xpp);
7041      eventType = nextNoWhitespace(xpp);
7042    }
7043    next(xpp);
7044    parseElementClose(res);
7045    return res;
7046  }
7047
7048  protected boolean parseClinicalUseDefinitionInteractionInteractantComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7049    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
7050      res.setItem(parseType("item", xpp));
7051    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7052      return false;
7053    }
7054    return true;
7055  }
7056
7057  protected ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent parseClinicalUseDefinitionUndesirableEffectComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7058    ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent();
7059    parseElementAttributes(xpp, res);
7060    next(xpp);
7061    int eventType = nextNoWhitespace(xpp);
7062    while (eventType != XmlPullParser.END_TAG) {
7063    if (!parseClinicalUseDefinitionUndesirableEffectComponentContent(eventType, xpp, res))
7064        unknownContent(xpp);
7065      eventType = nextNoWhitespace(xpp);
7066    }
7067    next(xpp);
7068    parseElementClose(res);
7069    return res;
7070  }
7071
7072  protected boolean parseClinicalUseDefinitionUndesirableEffectComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7073    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("symptomConditionEffect")) {
7074      res.setSymptomConditionEffect(parseCodeableReference(xpp));
7075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
7076      res.setClassification(parseCodeableConcept(xpp));
7077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyOfOccurrence")) {
7078      res.setFrequencyOfOccurrence(parseCodeableConcept(xpp));
7079    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7080      return false;
7081    }
7082    return true;
7083  }
7084
7085  protected ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent parseClinicalUseDefinitionWarningComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7086    ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent();
7087    parseElementAttributes(xpp, res);
7088    next(xpp);
7089    int eventType = nextNoWhitespace(xpp);
7090    while (eventType != XmlPullParser.END_TAG) {
7091    if (!parseClinicalUseDefinitionWarningComponentContent(eventType, xpp, res))
7092        unknownContent(xpp);
7093      eventType = nextNoWhitespace(xpp);
7094    }
7095    next(xpp);
7096    parseElementClose(res);
7097    return res;
7098  }
7099
7100  protected boolean parseClinicalUseDefinitionWarningComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7101    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7102      res.setDescriptionElement(parseMarkdown(xpp));
7103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7104      res.setCode(parseCodeableConcept(xpp));
7105    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7106      return false;
7107    }
7108    return true;
7109  }
7110
7111  protected ClinicalUseIssue parseClinicalUseIssue(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7112    ClinicalUseIssue res = new ClinicalUseIssue();
7113    parseResourceAttributes(xpp, res);
7114    next(xpp);
7115    int eventType = nextNoWhitespace(xpp);
7116    while (eventType != XmlPullParser.END_TAG) {
7117    if (!parseClinicalUseIssueContent(eventType, xpp, res))
7118        unknownContent(xpp);
7119      eventType = nextNoWhitespace(xpp);
7120    }
7121    next(xpp);
7122    parseElementClose(res);
7123    return res;
7124  }
7125
7126  protected boolean parseClinicalUseIssueContent(int eventType, XmlPullParser xpp, ClinicalUseIssue res) throws XmlPullParserException, IOException, FHIRFormatError {
7127    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7128      res.getIdentifier().add(parseIdentifier(xpp));
7129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7130      res.setTypeElement(parseEnumeration(xpp, Enumerations.ClinicalUseIssueType.NULL, new Enumerations.ClinicalUseIssueTypeEnumFactory()));
7131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7132      res.getCategory().add(parseCodeableConcept(xpp));
7133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7134      res.getSubject().add(parseReference(xpp));
7135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7136      res.setStatus(parseCodeableConcept(xpp));
7137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7138      res.setDescriptionElement(parseMarkdown(xpp));
7139    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contraindication")) {
7140      res.setContraindication(parseClinicalUseIssueContraindicationComponent(xpp));
7141    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
7142      res.setIndication(parseClinicalUseIssueIndicationComponent(xpp));
7143    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
7144      res.setInteraction(parseClinicalUseIssueInteractionComponent(xpp));
7145    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
7146      res.getPopulation().add(parsePopulation(xpp));
7147    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
7148      res.setUndesirableEffect(parseClinicalUseIssueUndesirableEffectComponent(xpp));
7149    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7150      return false;
7151    }
7152    return true;
7153  }
7154
7155  protected ClinicalUseIssue.ClinicalUseIssueContraindicationComponent parseClinicalUseIssueContraindicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7156    ClinicalUseIssue.ClinicalUseIssueContraindicationComponent res = new ClinicalUseIssue.ClinicalUseIssueContraindicationComponent();
7157    parseElementAttributes(xpp, res);
7158    next(xpp);
7159    int eventType = nextNoWhitespace(xpp);
7160    while (eventType != XmlPullParser.END_TAG) {
7161    if (!parseClinicalUseIssueContraindicationComponentContent(eventType, xpp, res))
7162        unknownContent(xpp);
7163      eventType = nextNoWhitespace(xpp);
7164    }
7165    next(xpp);
7166    parseElementClose(res);
7167    return res;
7168  }
7169
7170  protected boolean parseClinicalUseIssueContraindicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueContraindicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7171    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
7172      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
7173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
7174      res.setDiseaseStatus(parseCodeableReference(xpp));
7175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
7176      res.getComorbidity().add(parseCodeableReference(xpp));
7177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
7178      res.getIndication().add(parseReference(xpp));
7179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
7180      res.getOtherTherapy().add(parseClinicalUseIssueContraindicationOtherTherapyComponent(xpp));
7181    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7182      return false;
7183    }
7184    return true;
7185  }
7186
7187  protected ClinicalUseIssue.ClinicalUseIssueContraindicationOtherTherapyComponent parseClinicalUseIssueContraindicationOtherTherapyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7188    ClinicalUseIssue.ClinicalUseIssueContraindicationOtherTherapyComponent res = new ClinicalUseIssue.ClinicalUseIssueContraindicationOtherTherapyComponent();
7189    parseElementAttributes(xpp, res);
7190    next(xpp);
7191    int eventType = nextNoWhitespace(xpp);
7192    while (eventType != XmlPullParser.END_TAG) {
7193    if (!parseClinicalUseIssueContraindicationOtherTherapyComponentContent(eventType, xpp, res))
7194        unknownContent(xpp);
7195      eventType = nextNoWhitespace(xpp);
7196    }
7197    next(xpp);
7198    parseElementClose(res);
7199    return res;
7200  }
7201
7202  protected boolean parseClinicalUseIssueContraindicationOtherTherapyComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueContraindicationOtherTherapyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7203    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationshipType")) {
7204      res.setRelationshipType(parseCodeableConcept(xpp));
7205    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("therapy")) {
7206      res.setTherapy(parseCodeableReference(xpp));
7207    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7208      return false;
7209    }
7210    return true;
7211  }
7212
7213  protected ClinicalUseIssue.ClinicalUseIssueIndicationComponent parseClinicalUseIssueIndicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7214    ClinicalUseIssue.ClinicalUseIssueIndicationComponent res = new ClinicalUseIssue.ClinicalUseIssueIndicationComponent();
7215    parseElementAttributes(xpp, res);
7216    next(xpp);
7217    int eventType = nextNoWhitespace(xpp);
7218    while (eventType != XmlPullParser.END_TAG) {
7219    if (!parseClinicalUseIssueIndicationComponentContent(eventType, xpp, res))
7220        unknownContent(xpp);
7221      eventType = nextNoWhitespace(xpp);
7222    }
7223    next(xpp);
7224    parseElementClose(res);
7225    return res;
7226  }
7227
7228  protected boolean parseClinicalUseIssueIndicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueIndicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7229    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
7230      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
7231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
7232      res.setDiseaseStatus(parseCodeableReference(xpp));
7233    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
7234      res.getComorbidity().add(parseCodeableReference(xpp));
7235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intendedEffect")) {
7236      res.setIntendedEffect(parseCodeableReference(xpp));
7237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
7238      res.setDuration(parseQuantity(xpp));
7239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
7240      res.getUndesirableEffect().add(parseReference(xpp));
7241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
7242      res.getOtherTherapy().add(parseClinicalUseIssueContraindicationOtherTherapyComponent(xpp));
7243    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7244      return false;
7245    }
7246    return true;
7247  }
7248
7249  protected ClinicalUseIssue.ClinicalUseIssueInteractionComponent parseClinicalUseIssueInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7250    ClinicalUseIssue.ClinicalUseIssueInteractionComponent res = new ClinicalUseIssue.ClinicalUseIssueInteractionComponent();
7251    parseElementAttributes(xpp, res);
7252    next(xpp);
7253    int eventType = nextNoWhitespace(xpp);
7254    while (eventType != XmlPullParser.END_TAG) {
7255    if (!parseClinicalUseIssueInteractionComponentContent(eventType, xpp, res))
7256        unknownContent(xpp);
7257      eventType = nextNoWhitespace(xpp);
7258    }
7259    next(xpp);
7260    parseElementClose(res);
7261    return res;
7262  }
7263
7264  protected boolean parseClinicalUseIssueInteractionComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7265    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interactant")) {
7266      res.getInteractant().add(parseClinicalUseIssueInteractionInteractantComponent(xpp));
7267    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7268      res.setType(parseCodeableConcept(xpp));
7269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effect")) {
7270      res.setEffect(parseCodeableReference(xpp));
7271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incidence")) {
7272      res.setIncidence(parseCodeableConcept(xpp));
7273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("management")) {
7274      res.getManagement().add(parseCodeableConcept(xpp));
7275    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7276      return false;
7277    }
7278    return true;
7279  }
7280
7281  protected ClinicalUseIssue.ClinicalUseIssueInteractionInteractantComponent parseClinicalUseIssueInteractionInteractantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7282    ClinicalUseIssue.ClinicalUseIssueInteractionInteractantComponent res = new ClinicalUseIssue.ClinicalUseIssueInteractionInteractantComponent();
7283    parseElementAttributes(xpp, res);
7284    next(xpp);
7285    int eventType = nextNoWhitespace(xpp);
7286    while (eventType != XmlPullParser.END_TAG) {
7287    if (!parseClinicalUseIssueInteractionInteractantComponentContent(eventType, xpp, res))
7288        unknownContent(xpp);
7289      eventType = nextNoWhitespace(xpp);
7290    }
7291    next(xpp);
7292    parseElementClose(res);
7293    return res;
7294  }
7295
7296  protected boolean parseClinicalUseIssueInteractionInteractantComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueInteractionInteractantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7297    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
7298      res.setItem(parseType("item", xpp));
7299    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7300      return false;
7301    }
7302    return true;
7303  }
7304
7305  protected ClinicalUseIssue.ClinicalUseIssueUndesirableEffectComponent parseClinicalUseIssueUndesirableEffectComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7306    ClinicalUseIssue.ClinicalUseIssueUndesirableEffectComponent res = new ClinicalUseIssue.ClinicalUseIssueUndesirableEffectComponent();
7307    parseElementAttributes(xpp, res);
7308    next(xpp);
7309    int eventType = nextNoWhitespace(xpp);
7310    while (eventType != XmlPullParser.END_TAG) {
7311    if (!parseClinicalUseIssueUndesirableEffectComponentContent(eventType, xpp, res))
7312        unknownContent(xpp);
7313      eventType = nextNoWhitespace(xpp);
7314    }
7315    next(xpp);
7316    parseElementClose(res);
7317    return res;
7318  }
7319
7320  protected boolean parseClinicalUseIssueUndesirableEffectComponentContent(int eventType, XmlPullParser xpp, ClinicalUseIssue.ClinicalUseIssueUndesirableEffectComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7321    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("symptomConditionEffect")) {
7322      res.setSymptomConditionEffect(parseCodeableReference(xpp));
7323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
7324      res.setClassification(parseCodeableConcept(xpp));
7325    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyOfOccurrence")) {
7326      res.setFrequencyOfOccurrence(parseCodeableConcept(xpp));
7327    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7328      return false;
7329    }
7330    return true;
7331  }
7332
7333  protected CodeSystem parseCodeSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7334    CodeSystem res = new CodeSystem();
7335    parseResourceAttributes(xpp, res);
7336    next(xpp);
7337    int eventType = nextNoWhitespace(xpp);
7338    while (eventType != XmlPullParser.END_TAG) {
7339    if (!parseCodeSystemContent(eventType, xpp, res))
7340        unknownContent(xpp);
7341      eventType = nextNoWhitespace(xpp);
7342    }
7343    next(xpp);
7344    parseElementClose(res);
7345    return res;
7346  }
7347
7348  protected boolean parseCodeSystemContent(int eventType, XmlPullParser xpp, CodeSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
7349    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7350      res.setUrlElement(parseUri(xpp));
7351    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7352      res.getIdentifier().add(parseIdentifier(xpp));
7353    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7354      res.setVersionElement(parseString(xpp));
7355    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7356      res.setNameElement(parseString(xpp));
7357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7358      res.setTitleElement(parseString(xpp));
7359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7360      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7362      res.setExperimentalElement(parseBoolean(xpp));
7363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7364      res.setDateElement(parseDateTime(xpp));
7365    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7366      res.setPublisherElement(parseString(xpp));
7367    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7368      res.getContact().add(parseContactDetail(xpp));
7369    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7370      res.setDescriptionElement(parseMarkdown(xpp));
7371    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7372      res.getUseContext().add(parseUsageContext(xpp));
7373    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
7374      res.getJurisdiction().add(parseCodeableConcept(xpp));
7375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
7376      res.setPurposeElement(parseMarkdown(xpp));
7377    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
7378      res.setCopyrightElement(parseMarkdown(xpp));
7379    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caseSensitive")) {
7380      res.setCaseSensitiveElement(parseBoolean(xpp));
7381    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
7382      res.setValueSetElement(parseCanonical(xpp));
7383    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hierarchyMeaning")) {
7384      res.setHierarchyMeaningElement(parseEnumeration(xpp, CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()));
7385    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositional")) {
7386      res.setCompositionalElement(parseBoolean(xpp));
7387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionNeeded")) {
7388      res.setVersionNeededElement(parseBoolean(xpp));
7389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
7390      res.setContentElement(parseEnumeration(xpp, CodeSystem.CodeSystemContentMode.NULL, new CodeSystem.CodeSystemContentModeEnumFactory()));
7391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplements")) {
7392      res.setSupplementsElement(parseCanonical(xpp));
7393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
7394      res.setCountElement(parseUnsignedInt(xpp));
7395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
7396      res.getFilter().add(parseCodeSystemFilterComponent(xpp));
7397    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
7398      res.getProperty().add(parseCodeSystemPropertyComponent(xpp));
7399    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
7400      res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp));
7401    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
7402      return false;
7403    }
7404    return true;
7405  }
7406
7407  protected CodeSystem.CodeSystemFilterComponent parseCodeSystemFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7408    CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent();
7409    parseElementAttributes(xpp, res);
7410    next(xpp);
7411    int eventType = nextNoWhitespace(xpp);
7412    while (eventType != XmlPullParser.END_TAG) {
7413    if (!parseCodeSystemFilterComponentContent(eventType, xpp, res))
7414        unknownContent(xpp);
7415      eventType = nextNoWhitespace(xpp);
7416    }
7417    next(xpp);
7418    parseElementClose(res);
7419    return res;
7420  }
7421
7422  protected boolean parseCodeSystemFilterComponentContent(int eventType, XmlPullParser xpp, CodeSystem.CodeSystemFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7423    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7424      res.setCodeElement(parseCode(xpp));
7425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7426      res.setDescriptionElement(parseString(xpp));
7427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
7428      res.getOperator().add(parseEnumeration(xpp, Enumerations.FilterOperator.NULL, new Enumerations.FilterOperatorEnumFactory()));
7429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
7430      res.setValueElement(parseString(xpp));
7431    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7432      return false;
7433    }
7434    return true;
7435  }
7436
7437  protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7438    CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent();
7439    parseElementAttributes(xpp, res);
7440    next(xpp);
7441    int eventType = nextNoWhitespace(xpp);
7442    while (eventType != XmlPullParser.END_TAG) {
7443    if (!parseCodeSystemPropertyComponentContent(eventType, xpp, res))
7444        unknownContent(xpp);
7445      eventType = nextNoWhitespace(xpp);
7446    }
7447    next(xpp);
7448    parseElementClose(res);
7449    return res;
7450  }
7451
7452  protected boolean parseCodeSystemPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem.PropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7453    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7454      res.setCodeElement(parseCode(xpp));
7455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
7456      res.setUriElement(parseUri(xpp));
7457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7458      res.setDescriptionElement(parseString(xpp));
7459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7460      res.setTypeElement(parseEnumeration(xpp, CodeSystem.PropertyType.NULL, new CodeSystem.PropertyTypeEnumFactory()));
7461    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7462      return false;
7463    }
7464    return true;
7465  }
7466
7467  protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7468    CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent();
7469    parseElementAttributes(xpp, res);
7470    next(xpp);
7471    int eventType = nextNoWhitespace(xpp);
7472    while (eventType != XmlPullParser.END_TAG) {
7473    if (!parseCodeSystemConceptDefinitionComponentContent(eventType, xpp, res))
7474        unknownContent(xpp);
7475      eventType = nextNoWhitespace(xpp);
7476    }
7477    next(xpp);
7478    parseElementClose(res);
7479    return res;
7480  }
7481
7482  protected boolean parseCodeSystemConceptDefinitionComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptDefinitionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7483    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7484      res.setCodeElement(parseCode(xpp));
7485    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
7486      res.setDisplayElement(parseString(xpp));
7487    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
7488      res.setDefinitionElement(parseString(xpp));
7489    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7490      res.getDesignation().add(parseCodeSystemConceptDefinitionDesignationComponent(xpp));
7491    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
7492      res.getProperty().add(parseCodeSystemConceptPropertyComponent(xpp));
7493    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
7494      res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp));
7495    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7496      return false;
7497    }
7498    return true;
7499  }
7500
7501  protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7502    CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent();
7503    parseElementAttributes(xpp, res);
7504    next(xpp);
7505    int eventType = nextNoWhitespace(xpp);
7506    while (eventType != XmlPullParser.END_TAG) {
7507    if (!parseCodeSystemConceptDefinitionDesignationComponentContent(eventType, xpp, res))
7508        unknownContent(xpp);
7509      eventType = nextNoWhitespace(xpp);
7510    }
7511    next(xpp);
7512    parseElementClose(res);
7513    return res;
7514  }
7515
7516  protected boolean parseCodeSystemConceptDefinitionDesignationComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptDefinitionDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7517    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7518      res.setLanguageElement(parseCode(xpp));
7519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7520      res.setUse(parseCoding(xpp));
7521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
7522      res.setValueElement(parseString(xpp));
7523    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7524      return false;
7525    }
7526    return true;
7527  }
7528
7529  protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7530    CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent();
7531    parseElementAttributes(xpp, res);
7532    next(xpp);
7533    int eventType = nextNoWhitespace(xpp);
7534    while (eventType != XmlPullParser.END_TAG) {
7535    if (!parseCodeSystemConceptPropertyComponentContent(eventType, xpp, res))
7536        unknownContent(xpp);
7537      eventType = nextNoWhitespace(xpp);
7538    }
7539    next(xpp);
7540    parseElementClose(res);
7541    return res;
7542  }
7543
7544  protected boolean parseCodeSystemConceptPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7545    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7546      res.setCodeElement(parseCode(xpp));
7547    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
7548      res.setValue(parseType("value", xpp));
7549    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7550      return false;
7551    }
7552    return true;
7553  }
7554
7555  protected Communication parseCommunication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7556    Communication res = new Communication();
7557    parseResourceAttributes(xpp, res);
7558    next(xpp);
7559    int eventType = nextNoWhitespace(xpp);
7560    while (eventType != XmlPullParser.END_TAG) {
7561    if (!parseCommunicationContent(eventType, xpp, res))
7562        unknownContent(xpp);
7563      eventType = nextNoWhitespace(xpp);
7564    }
7565    next(xpp);
7566    parseElementClose(res);
7567    return res;
7568  }
7569
7570  protected boolean parseCommunicationContent(int eventType, XmlPullParser xpp, Communication res) throws XmlPullParserException, IOException, FHIRFormatError {
7571    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7572      res.getIdentifier().add(parseIdentifier(xpp));
7573    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesCanonical")) {
7574      res.getInstantiatesCanonical().add(parseCanonical(xpp));
7575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesUri")) {
7576      res.getInstantiatesUri().add(parseUri(xpp));
7577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
7578      res.getBasedOn().add(parseReference(xpp));
7579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
7580      res.getPartOf().add(parseReference(xpp));
7581    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inResponseTo")) {
7582      res.getInResponseTo().add(parseReference(xpp));
7583    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7584      res.setStatusElement(parseEnumeration(xpp, Enumerations.EventStatus.NULL, new Enumerations.EventStatusEnumFactory()));
7585    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
7586      res.setStatusReason(parseCodeableConcept(xpp));
7587    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7588      res.getCategory().add(parseCodeableConcept(xpp));
7589    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7590      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
7591    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
7592      res.getMedium().add(parseCodeableConcept(xpp));
7593    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7594      res.setSubject(parseReference(xpp));
7595    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
7596      res.setTopic(parseCodeableConcept(xpp));
7597    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("about")) {
7598      res.getAbout().add(parseReference(xpp));
7599    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7600      res.setEncounter(parseReference(xpp));
7601    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sent")) {
7602      res.setSentElement(parseDateTime(xpp));
7603    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("received")) {
7604      res.setReceivedElement(parseDateTime(xpp));
7605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
7606      res.getRecipient().add(parseReference(xpp));
7607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
7608      res.setSender(parseReference(xpp));
7609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7610      res.getReason().add(parseCodeableReference(xpp));
7611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
7612      res.getPayload().add(parseCommunicationPayloadComponent(xpp));
7613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
7614      res.getNote().add(parseAnnotation(xpp));
7615    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7616      return false;
7617    }
7618    return true;
7619  }
7620
7621  protected Communication.CommunicationPayloadComponent parseCommunicationPayloadComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7622    Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent();
7623    parseElementAttributes(xpp, res);
7624    next(xpp);
7625    int eventType = nextNoWhitespace(xpp);
7626    while (eventType != XmlPullParser.END_TAG) {
7627    if (!parseCommunicationPayloadComponentContent(eventType, xpp, res))
7628        unknownContent(xpp);
7629      eventType = nextNoWhitespace(xpp);
7630    }
7631    next(xpp);
7632    parseElementClose(res);
7633    return res;
7634  }
7635
7636  protected boolean parseCommunicationPayloadComponentContent(int eventType, XmlPullParser xpp, Communication.CommunicationPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7637    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
7638      res.setContent(parseType("content", xpp));
7639    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7640      return false;
7641    }
7642    return true;
7643  }
7644
7645  protected CommunicationRequest parseCommunicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7646    CommunicationRequest res = new CommunicationRequest();
7647    parseResourceAttributes(xpp, res);
7648    next(xpp);
7649    int eventType = nextNoWhitespace(xpp);
7650    while (eventType != XmlPullParser.END_TAG) {
7651    if (!parseCommunicationRequestContent(eventType, xpp, res))
7652        unknownContent(xpp);
7653      eventType = nextNoWhitespace(xpp);
7654    }
7655    next(xpp);
7656    parseElementClose(res);
7657    return res;
7658  }
7659
7660  protected boolean parseCommunicationRequestContent(int eventType, XmlPullParser xpp, CommunicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7661    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7662      res.getIdentifier().add(parseIdentifier(xpp));
7663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
7664      res.getBasedOn().add(parseReference(xpp));
7665    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
7666      res.getReplaces().add(parseReference(xpp));
7667    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
7668      res.setGroupIdentifier(parseIdentifier(xpp));
7669    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7670      res.setStatusElement(parseEnumeration(xpp, Enumerations.RequestStatus.NULL, new Enumerations.RequestStatusEnumFactory()));
7671    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
7672      res.setStatusReason(parseCodeableConcept(xpp));
7673    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
7674      res.setIntentElement(parseEnumeration(xpp, Enumerations.RequestIntent.NULL, new Enumerations.RequestIntentEnumFactory()));
7675    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7676      res.getCategory().add(parseCodeableConcept(xpp));
7677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7678      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
7679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
7680      res.setDoNotPerformElement(parseBoolean(xpp));
7681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
7682      res.getMedium().add(parseCodeableConcept(xpp));
7683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7684      res.setSubject(parseReference(xpp));
7685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("about")) {
7686      res.getAbout().add(parseReference(xpp));
7687    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7688      res.setEncounter(parseReference(xpp));
7689    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
7690      res.getPayload().add(parseCommunicationRequestPayloadComponent(xpp));
7691    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
7692      res.setOccurrence(parseType("occurrence", xpp));
7693    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
7694      res.setAuthoredOnElement(parseDateTime(xpp));
7695    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
7696      res.setRequester(parseReference(xpp));
7697    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
7698      res.getRecipient().add(parseReference(xpp));
7699    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationProvider")) {
7700      res.getInformationProvider().add(parseReference(xpp));
7701    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7702      res.getReason().add(parseCodeableReference(xpp));
7703    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
7704      res.getNote().add(parseAnnotation(xpp));
7705    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7706      return false;
7707    }
7708    return true;
7709  }
7710
7711  protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestPayloadComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7712    CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent();
7713    parseElementAttributes(xpp, res);
7714    next(xpp);
7715    int eventType = nextNoWhitespace(xpp);
7716    while (eventType != XmlPullParser.END_TAG) {
7717    if (!parseCommunicationRequestPayloadComponentContent(eventType, xpp, res))
7718        unknownContent(xpp);
7719      eventType = nextNoWhitespace(xpp);
7720    }
7721    next(xpp);
7722    parseElementClose(res);
7723    return res;
7724  }
7725
7726  protected boolean parseCommunicationRequestPayloadComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest.CommunicationRequestPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7727    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
7728      res.setContent(parseType("content", xpp));
7729    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7730      return false;
7731    }
7732    return true;
7733  }
7734
7735  protected CompartmentDefinition parseCompartmentDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7736    CompartmentDefinition res = new CompartmentDefinition();
7737    parseResourceAttributes(xpp, res);
7738    next(xpp);
7739    int eventType = nextNoWhitespace(xpp);
7740    while (eventType != XmlPullParser.END_TAG) {
7741    if (!parseCompartmentDefinitionContent(eventType, xpp, res))
7742        unknownContent(xpp);
7743      eventType = nextNoWhitespace(xpp);
7744    }
7745    next(xpp);
7746    parseElementClose(res);
7747    return res;
7748  }
7749
7750  protected boolean parseCompartmentDefinitionContent(int eventType, XmlPullParser xpp, CompartmentDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
7751    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7752      res.setUrlElement(parseUri(xpp));
7753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7754      res.setVersionElement(parseString(xpp));
7755    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7756      res.setNameElement(parseString(xpp));
7757    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7758      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7759    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7760      res.setExperimentalElement(parseBoolean(xpp));
7761    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7762      res.setDateElement(parseDateTime(xpp));
7763    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7764      res.setPublisherElement(parseString(xpp));
7765    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7766      res.getContact().add(parseContactDetail(xpp));
7767    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7768      res.setDescriptionElement(parseMarkdown(xpp));
7769    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7770      res.getUseContext().add(parseUsageContext(xpp));
7771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
7772      res.setPurposeElement(parseMarkdown(xpp));
7773    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7774      res.setCodeElement(parseEnumeration(xpp, Enumerations.CompartmentType.NULL, new Enumerations.CompartmentTypeEnumFactory()));
7775    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
7776      res.setSearchElement(parseBoolean(xpp));
7777    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
7778      res.getResource().add(parseCompartmentDefinitionResourceComponent(xpp));
7779    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
7780      return false;
7781    }
7782    return true;
7783  }
7784
7785  protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionResourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7786    CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent();
7787    parseElementAttributes(xpp, res);
7788    next(xpp);
7789    int eventType = nextNoWhitespace(xpp);
7790    while (eventType != XmlPullParser.END_TAG) {
7791    if (!parseCompartmentDefinitionResourceComponentContent(eventType, xpp, res))
7792        unknownContent(xpp);
7793      eventType = nextNoWhitespace(xpp);
7794    }
7795    next(xpp);
7796    parseElementClose(res);
7797    return res;
7798  }
7799
7800  protected boolean parseCompartmentDefinitionResourceComponentContent(int eventType, XmlPullParser xpp, CompartmentDefinition.CompartmentDefinitionResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7801    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7802      res.setCodeElement(parseCode(xpp));
7803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
7804      res.getParam().add(parseString(xpp));
7805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
7806      res.setDocumentationElement(parseString(xpp));
7807    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7808      return false;
7809    }
7810    return true;
7811  }
7812
7813  protected Composition parseComposition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7814    Composition res = new Composition();
7815    parseResourceAttributes(xpp, res);
7816    next(xpp);
7817    int eventType = nextNoWhitespace(xpp);
7818    while (eventType != XmlPullParser.END_TAG) {
7819    if (!parseCompositionContent(eventType, xpp, res))
7820        unknownContent(xpp);
7821      eventType = nextNoWhitespace(xpp);
7822    }
7823    next(xpp);
7824    parseElementClose(res);
7825    return res;
7826  }
7827
7828  protected boolean parseCompositionContent(int eventType, XmlPullParser xpp, Composition res) throws XmlPullParserException, IOException, FHIRFormatError {
7829    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7830      res.setIdentifier(parseIdentifier(xpp));
7831    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7832      res.setStatusElement(parseEnumeration(xpp, Enumerations.CompositionStatus.NULL, new Enumerations.CompositionStatusEnumFactory()));
7833    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7834      res.setType(parseCodeableConcept(xpp));
7835    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7836      res.getCategory().add(parseCodeableConcept(xpp));
7837    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7838      res.setSubject(parseReference(xpp));
7839    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7840      res.setEncounter(parseReference(xpp));
7841    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7842      res.setDateElement(parseDateTime(xpp));
7843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
7844      res.getAuthor().add(parseReference(xpp));
7845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7846      res.setTitleElement(parseString(xpp));
7847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("confidentiality")) {
7848      res.setConfidentialityElement(parseCode(xpp));
7849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attester")) {
7850      res.getAttester().add(parseCompositionAttesterComponent(xpp));
7851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
7852      res.setCustodian(parseReference(xpp));
7853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
7854      res.getRelatesTo().add(parseRelatedArtifact(xpp));
7855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
7856      res.getEvent().add(parseCompositionEventComponent(xpp));
7857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
7858      res.getSection().add(parseCompositionSectionComponent(xpp));
7859    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7860      return false;
7861    }
7862    return true;
7863  }
7864
7865  protected Composition.CompositionAttesterComponent parseCompositionAttesterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7866    Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent();
7867    parseElementAttributes(xpp, res);
7868    next(xpp);
7869    int eventType = nextNoWhitespace(xpp);
7870    while (eventType != XmlPullParser.END_TAG) {
7871    if (!parseCompositionAttesterComponentContent(eventType, xpp, res))
7872        unknownContent(xpp);
7873      eventType = nextNoWhitespace(xpp);
7874    }
7875    next(xpp);
7876    parseElementClose(res);
7877    return res;
7878  }
7879
7880  protected boolean parseCompositionAttesterComponentContent(int eventType, XmlPullParser xpp, Composition.CompositionAttesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7881    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
7882      res.setMode(parseCodeableConcept(xpp));
7883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
7884      res.setTimeElement(parseDateTime(xpp));
7885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
7886      res.setParty(parseReference(xpp));
7887    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7888      return false;
7889    }
7890    return true;
7891  }
7892
7893  protected Composition.CompositionEventComponent parseCompositionEventComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7894    Composition.CompositionEventComponent res = new Composition.CompositionEventComponent();
7895    parseElementAttributes(xpp, res);
7896    next(xpp);
7897    int eventType = nextNoWhitespace(xpp);
7898    while (eventType != XmlPullParser.END_TAG) {
7899    if (!parseCompositionEventComponentContent(eventType, xpp, res))
7900        unknownContent(xpp);
7901      eventType = nextNoWhitespace(xpp);
7902    }
7903    next(xpp);
7904    parseElementClose(res);
7905    return res;
7906  }
7907
7908  protected boolean parseCompositionEventComponentContent(int eventType, XmlPullParser xpp, Composition.CompositionEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7909    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7910      res.getCode().add(parseCodeableConcept(xpp));
7911    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7912      res.setPeriod(parsePeriod(xpp));
7913    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
7914      res.getDetail().add(parseReference(xpp));
7915    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7916      return false;
7917    }
7918    return true;
7919  }
7920
7921  protected Composition.SectionComponent parseCompositionSectionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7922    Composition.SectionComponent res = new Composition.SectionComponent();
7923    parseElementAttributes(xpp, res);
7924    next(xpp);
7925    int eventType = nextNoWhitespace(xpp);
7926    while (eventType != XmlPullParser.END_TAG) {
7927    if (!parseCompositionSectionComponentContent(eventType, xpp, res))
7928        unknownContent(xpp);
7929      eventType = nextNoWhitespace(xpp);
7930    }
7931    next(xpp);
7932    parseElementClose(res);
7933    return res;
7934  }
7935
7936  protected boolean parseCompositionSectionComponentContent(int eventType, XmlPullParser xpp, Composition.SectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7937    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7938      res.setTitleElement(parseString(xpp));
7939    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7940      res.setCode(parseCodeableConcept(xpp));
7941    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
7942      res.getAuthor().add(parseReference(xpp));
7943    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
7944      res.setFocus(parseReference(xpp));
7945    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
7946      res.setText(parseNarrative(xpp));
7947    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
7948      res.setModeElement(parseEnumeration(xpp, Enumerations.ListMode.NULL, new Enumerations.ListModeEnumFactory()));
7949    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
7950      res.setOrderedBy(parseCodeableConcept(xpp));
7951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
7952      res.getEntry().add(parseReference(xpp));
7953    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
7954      res.setEmptyReason(parseCodeableConcept(xpp));
7955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
7956      res.getSection().add(parseCompositionSectionComponent(xpp));
7957    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7958      return false;
7959    }
7960    return true;
7961  }
7962
7963  protected ConceptMap parseConceptMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7964    ConceptMap res = new ConceptMap();
7965    parseResourceAttributes(xpp, res);
7966    next(xpp);
7967    int eventType = nextNoWhitespace(xpp);
7968    while (eventType != XmlPullParser.END_TAG) {
7969    if (!parseConceptMapContent(eventType, xpp, res))
7970        unknownContent(xpp);
7971      eventType = nextNoWhitespace(xpp);
7972    }
7973    next(xpp);
7974    parseElementClose(res);
7975    return res;
7976  }
7977
7978  protected boolean parseConceptMapContent(int eventType, XmlPullParser xpp, ConceptMap res) throws XmlPullParserException, IOException, FHIRFormatError {
7979    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7980      res.setUrlElement(parseUri(xpp));
7981    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7982      res.getIdentifier().add(parseIdentifier(xpp));
7983    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7984      res.setVersionElement(parseString(xpp));
7985    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7986      res.setNameElement(parseString(xpp));
7987    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7988      res.setTitleElement(parseString(xpp));
7989    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7990      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7992      res.setExperimentalElement(parseBoolean(xpp));
7993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7994      res.setDateElement(parseDateTime(xpp));
7995    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7996      res.setPublisherElement(parseString(xpp));
7997    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7998      res.getContact().add(parseContactDetail(xpp));
7999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8000      res.setDescriptionElement(parseMarkdown(xpp));
8001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8002      res.getUseContext().add(parseUsageContext(xpp));
8003    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
8004      res.getJurisdiction().add(parseCodeableConcept(xpp));
8005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
8006      res.setPurposeElement(parseMarkdown(xpp));
8007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
8008      res.setCopyrightElement(parseMarkdown(xpp));
8009    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
8010      res.setSource(parseType("source", xpp));
8011    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
8012      res.setTarget(parseType("target", xpp));
8013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
8014      res.getGroup().add(parseConceptMapGroupComponent(xpp));
8015    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
8016      return false;
8017    }
8018    return true;
8019  }
8020
8021  protected ConceptMap.ConceptMapGroupComponent parseConceptMapGroupComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8022    ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent();
8023    parseElementAttributes(xpp, res);
8024    next(xpp);
8025    int eventType = nextNoWhitespace(xpp);
8026    while (eventType != XmlPullParser.END_TAG) {
8027    if (!parseConceptMapGroupComponentContent(eventType, xpp, res))
8028        unknownContent(xpp);
8029      eventType = nextNoWhitespace(xpp);
8030    }
8031    next(xpp);
8032    parseElementClose(res);
8033    return res;
8034  }
8035
8036  protected boolean parseConceptMapGroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap.ConceptMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8037    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
8038      res.setSourceElement(parseCanonical(xpp));
8039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8040      res.setTargetElement(parseCanonical(xpp));
8041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
8042      res.getElement().add(parseConceptMapSourceElementComponent(xpp));
8043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
8044      res.setUnmapped(parseConceptMapGroupUnmappedComponent(xpp));
8045    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8046      return false;
8047    }
8048    return true;
8049  }
8050
8051  protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8052    ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent();
8053    parseElementAttributes(xpp, res);
8054    next(xpp);
8055    int eventType = nextNoWhitespace(xpp);
8056    while (eventType != XmlPullParser.END_TAG) {
8057    if (!parseConceptMapSourceElementComponentContent(eventType, xpp, res))
8058        unknownContent(xpp);
8059      eventType = nextNoWhitespace(xpp);
8060    }
8061    next(xpp);
8062    parseElementClose(res);
8063    return res;
8064  }
8065
8066  protected boolean parseConceptMapSourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8067    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8068      res.setCodeElement(parseCode(xpp));
8069    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8070      res.setDisplayElement(parseString(xpp));
8071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noMap")) {
8072      res.setNoMapElement(parseBoolean(xpp));
8073    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8074      res.getTarget().add(parseConceptMapTargetElementComponent(xpp));
8075    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8076      return false;
8077    }
8078    return true;
8079  }
8080
8081  protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8082    ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent();
8083    parseElementAttributes(xpp, res);
8084    next(xpp);
8085    int eventType = nextNoWhitespace(xpp);
8086    while (eventType != XmlPullParser.END_TAG) {
8087    if (!parseConceptMapTargetElementComponentContent(eventType, xpp, res))
8088        unknownContent(xpp);
8089      eventType = nextNoWhitespace(xpp);
8090    }
8091    next(xpp);
8092    parseElementClose(res);
8093    return res;
8094  }
8095
8096  protected boolean parseConceptMapTargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8097    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8098      res.setCodeElement(parseCode(xpp));
8099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8100      res.setDisplayElement(parseString(xpp));
8101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8102      res.setRelationshipElement(parseEnumeration(xpp, Enumerations.ConceptMapRelationship.NULL, new Enumerations.ConceptMapRelationshipEnumFactory()));
8103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
8104      res.setCommentElement(parseString(xpp));
8105    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
8106      res.getDependsOn().add(parseConceptMapOtherElementComponent(xpp));
8107    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
8108      res.getProduct().add(parseConceptMapOtherElementComponent(xpp));
8109    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8110      return false;
8111    }
8112    return true;
8113  }
8114
8115  protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8116    ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent();
8117    parseElementAttributes(xpp, res);
8118    next(xpp);
8119    int eventType = nextNoWhitespace(xpp);
8120    while (eventType != XmlPullParser.END_TAG) {
8121    if (!parseConceptMapOtherElementComponentContent(eventType, xpp, res))
8122        unknownContent(xpp);
8123      eventType = nextNoWhitespace(xpp);
8124    }
8125    next(xpp);
8126    parseElementClose(res);
8127    return res;
8128  }
8129
8130  protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8131    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
8132      res.setPropertyElement(parseUri(xpp));
8133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
8134      res.setSystemElement(parseCanonical(xpp));
8135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
8136      res.setValueElement(parseString(xpp));
8137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8138      res.setDisplayElement(parseString(xpp));
8139    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8140      return false;
8141    }
8142    return true;
8143  }
8144
8145  protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapGroupUnmappedComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8146    ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent();
8147    parseElementAttributes(xpp, res);
8148    next(xpp);
8149    int eventType = nextNoWhitespace(xpp);
8150    while (eventType != XmlPullParser.END_TAG) {
8151    if (!parseConceptMapGroupUnmappedComponentContent(eventType, xpp, res))
8152        unknownContent(xpp);
8153      eventType = nextNoWhitespace(xpp);
8154    }
8155    next(xpp);
8156    parseElementClose(res);
8157    return res;
8158  }
8159
8160  protected boolean parseConceptMapGroupUnmappedComponentContent(int eventType, XmlPullParser xpp, ConceptMap.ConceptMapGroupUnmappedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8161    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
8162      res.setModeElement(parseEnumeration(xpp, Enumerations.ConceptMapGroupUnmappedMode.NULL, new Enumerations.ConceptMapGroupUnmappedModeEnumFactory()));
8163    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8164      res.setCodeElement(parseCode(xpp));
8165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8166      res.setDisplayElement(parseString(xpp));
8167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8168      res.setUrlElement(parseCanonical(xpp));
8169    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8170      return false;
8171    }
8172    return true;
8173  }
8174
8175  protected ConceptMap2 parseConceptMap2(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8176    ConceptMap2 res = new ConceptMap2();
8177    parseResourceAttributes(xpp, res);
8178    next(xpp);
8179    int eventType = nextNoWhitespace(xpp);
8180    while (eventType != XmlPullParser.END_TAG) {
8181    if (!parseConceptMap2Content(eventType, xpp, res))
8182        unknownContent(xpp);
8183      eventType = nextNoWhitespace(xpp);
8184    }
8185    next(xpp);
8186    parseElementClose(res);
8187    return res;
8188  }
8189
8190  protected boolean parseConceptMap2Content(int eventType, XmlPullParser xpp, ConceptMap2 res) throws XmlPullParserException, IOException, FHIRFormatError {
8191    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8192      res.setUrlElement(parseUri(xpp));
8193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8194      res.getIdentifier().add(parseIdentifier(xpp));
8195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
8196      res.setVersionElement(parseString(xpp));
8197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8198      res.setNameElement(parseString(xpp));
8199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
8200      res.setTitleElement(parseString(xpp));
8201    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8202      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
8203    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
8204      res.setExperimentalElement(parseBoolean(xpp));
8205    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8206      res.setDateElement(parseDateTime(xpp));
8207    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
8208      res.setPublisherElement(parseString(xpp));
8209    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
8210      res.getContact().add(parseContactDetail(xpp));
8211    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8212      res.setDescriptionElement(parseMarkdown(xpp));
8213    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8214      res.getUseContext().add(parseUsageContext(xpp));
8215    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
8216      res.getJurisdiction().add(parseCodeableConcept(xpp));
8217    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
8218      res.setPurposeElement(parseMarkdown(xpp));
8219    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
8220      res.setCopyrightElement(parseMarkdown(xpp));
8221    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
8222      res.setSource(parseType("source", xpp));
8223    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
8224      res.setTarget(parseType("target", xpp));
8225    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
8226      res.getGroup().add(parseConceptMap2GroupComponent(xpp));
8227    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
8228      return false;
8229    }
8230    return true;
8231  }
8232
8233  protected ConceptMap2.ConceptMap2GroupComponent parseConceptMap2GroupComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8234    ConceptMap2.ConceptMap2GroupComponent res = new ConceptMap2.ConceptMap2GroupComponent();
8235    parseElementAttributes(xpp, res);
8236    next(xpp);
8237    int eventType = nextNoWhitespace(xpp);
8238    while (eventType != XmlPullParser.END_TAG) {
8239    if (!parseConceptMap2GroupComponentContent(eventType, xpp, res))
8240        unknownContent(xpp);
8241      eventType = nextNoWhitespace(xpp);
8242    }
8243    next(xpp);
8244    parseElementClose(res);
8245    return res;
8246  }
8247
8248  protected boolean parseConceptMap2GroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap2.ConceptMap2GroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8249    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
8250      res.setSourceElement(parseCanonical(xpp));
8251    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8252      res.setTargetElement(parseCanonical(xpp));
8253    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
8254      res.getElement().add(parseConceptMap2SourceElementComponent(xpp));
8255    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
8256      res.setUnmapped(parseConceptMap2GroupUnmappedComponent(xpp));
8257    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8258      return false;
8259    }
8260    return true;
8261  }
8262
8263  protected ConceptMap2.SourceElementComponent parseConceptMap2SourceElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8264    ConceptMap2.SourceElementComponent res = new ConceptMap2.SourceElementComponent();
8265    parseElementAttributes(xpp, res);
8266    next(xpp);
8267    int eventType = nextNoWhitespace(xpp);
8268    while (eventType != XmlPullParser.END_TAG) {
8269    if (!parseConceptMap2SourceElementComponentContent(eventType, xpp, res))
8270        unknownContent(xpp);
8271      eventType = nextNoWhitespace(xpp);
8272    }
8273    next(xpp);
8274    parseElementClose(res);
8275    return res;
8276  }
8277
8278  protected boolean parseConceptMap2SourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap2.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8279    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8280      res.setCodeElement(parseCode(xpp));
8281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8282      res.setDisplayElement(parseString(xpp));
8283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8284      res.setValueSetElement(parseCanonical(xpp));
8285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noMap")) {
8286      res.setNoMapElement(parseBoolean(xpp));
8287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8288      res.getTarget().add(parseConceptMap2TargetElementComponent(xpp));
8289    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8290      return false;
8291    }
8292    return true;
8293  }
8294
8295  protected ConceptMap2.TargetElementComponent parseConceptMap2TargetElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8296    ConceptMap2.TargetElementComponent res = new ConceptMap2.TargetElementComponent();
8297    parseElementAttributes(xpp, res);
8298    next(xpp);
8299    int eventType = nextNoWhitespace(xpp);
8300    while (eventType != XmlPullParser.END_TAG) {
8301    if (!parseConceptMap2TargetElementComponentContent(eventType, xpp, res))
8302        unknownContent(xpp);
8303      eventType = nextNoWhitespace(xpp);
8304    }
8305    next(xpp);
8306    parseElementClose(res);
8307    return res;
8308  }
8309
8310  protected boolean parseConceptMap2TargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap2.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8311    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8312      res.setCodeElement(parseCode(xpp));
8313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8314      res.setDisplayElement(parseString(xpp));
8315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8316      res.setValueSetElement(parseCanonical(xpp));
8317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8318      res.setRelationshipElement(parseEnumeration(xpp, Enumerations.ConceptMapRelationship.NULL, new Enumerations.ConceptMapRelationshipEnumFactory()));
8319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
8320      res.setCommentElement(parseString(xpp));
8321    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
8322      res.getDependsOn().add(parseConceptMap2OtherElementComponent(xpp));
8323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
8324      res.getProduct().add(parseConceptMap2OtherElementComponent(xpp));
8325    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8326      return false;
8327    }
8328    return true;
8329  }
8330
8331  protected ConceptMap2.OtherElementComponent parseConceptMap2OtherElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8332    ConceptMap2.OtherElementComponent res = new ConceptMap2.OtherElementComponent();
8333    parseElementAttributes(xpp, res);
8334    next(xpp);
8335    int eventType = nextNoWhitespace(xpp);
8336    while (eventType != XmlPullParser.END_TAG) {
8337    if (!parseConceptMap2OtherElementComponentContent(eventType, xpp, res))
8338        unknownContent(xpp);
8339      eventType = nextNoWhitespace(xpp);
8340    }
8341    next(xpp);
8342    parseElementClose(res);
8343    return res;
8344  }
8345
8346  protected boolean parseConceptMap2OtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap2.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8347    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
8348      res.setPropertyElement(parseUri(xpp));
8349    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8350      res.setValue(parseType("value", xpp));
8351    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8352      return false;
8353    }
8354    return true;
8355  }
8356
8357  protected ConceptMap2.ConceptMap2GroupUnmappedComponent parseConceptMap2GroupUnmappedComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8358    ConceptMap2.ConceptMap2GroupUnmappedComponent res = new ConceptMap2.ConceptMap2GroupUnmappedComponent();
8359    parseElementAttributes(xpp, res);
8360    next(xpp);
8361    int eventType = nextNoWhitespace(xpp);
8362    while (eventType != XmlPullParser.END_TAG) {
8363    if (!parseConceptMap2GroupUnmappedComponentContent(eventType, xpp, res))
8364        unknownContent(xpp);
8365      eventType = nextNoWhitespace(xpp);
8366    }
8367    next(xpp);
8368    parseElementClose(res);
8369    return res;
8370  }
8371
8372  protected boolean parseConceptMap2GroupUnmappedComponentContent(int eventType, XmlPullParser xpp, ConceptMap2.ConceptMap2GroupUnmappedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8373    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
8374      res.setModeElement(parseEnumeration(xpp, Enumerations.ConceptMapGroupUnmappedMode.NULL, new Enumerations.ConceptMapGroupUnmappedModeEnumFactory()));
8375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8376      res.setCodeElement(parseCode(xpp));
8377    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8378      res.setDisplayElement(parseString(xpp));
8379    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8380      res.setValueSetElement(parseCanonical(xpp));
8381    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8382      res.setUrlElement(parseCanonical(xpp));
8383    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8384      return false;
8385    }
8386    return true;
8387  }
8388
8389  protected Condition parseCondition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8390    Condition res = new Condition();
8391    parseResourceAttributes(xpp, res);
8392    next(xpp);
8393    int eventType = nextNoWhitespace(xpp);
8394    while (eventType != XmlPullParser.END_TAG) {
8395    if (!parseConditionContent(eventType, xpp, res))
8396        unknownContent(xpp);
8397      eventType = nextNoWhitespace(xpp);
8398    }
8399    next(xpp);
8400    parseElementClose(res);
8401    return res;
8402  }
8403
8404  protected boolean parseConditionContent(int eventType, XmlPullParser xpp, Condition res) throws XmlPullParserException, IOException, FHIRFormatError {
8405    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8406      res.getIdentifier().add(parseIdentifier(xpp));
8407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
8408      res.setClinicalStatus(parseCodeableConcept(xpp));
8409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
8410      res.setVerificationStatus(parseCodeableConcept(xpp));
8411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8412      res.getCategory().add(parseCodeableConcept(xpp));
8413    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
8414      res.setSeverity(parseCodeableConcept(xpp));
8415    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8416      res.setCode(parseCodeableConcept(xpp));
8417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
8418      res.getBodySite().add(parseCodeableConcept(xpp));
8419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
8420      res.setSubject(parseReference(xpp));
8421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
8422      res.setEncounter(parseReference(xpp));
8423    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
8424      res.setOnset(parseType("onset", xpp));
8425    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "abatement")) {
8426      res.setAbatement(parseType("abatement", xpp));
8427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedDate")) {
8428      res.setRecordedDateElement(parseDateTime(xpp));
8429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
8430      res.setRecorder(parseReference(xpp));
8431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
8432      res.setAsserter(parseReference(xpp));
8433    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stage")) {
8434      res.getStage().add(parseConditionStageComponent(xpp));
8435    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evidence")) {
8436      res.getEvidence().add(parseConditionEvidenceComponent(xpp));
8437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
8438      res.getNote().add(parseAnnotation(xpp));
8439    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
8440      return false;
8441    }
8442    return true;
8443  }
8444
8445  protected Condition.ConditionStageComponent parseConditionStageComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8446    Condition.ConditionStageComponent res = new Condition.ConditionStageComponent();
8447    parseElementAttributes(xpp, res);
8448    next(xpp);
8449    int eventType = nextNoWhitespace(xpp);
8450    while (eventType != XmlPullParser.END_TAG) {
8451    if (!parseConditionStageComponentContent(eventType, xpp, res))
8452        unknownContent(xpp);
8453      eventType = nextNoWhitespace(xpp);
8454    }
8455    next(xpp);
8456    parseElementClose(res);
8457    return res;
8458  }
8459
8460  protected boolean parseConditionStageComponentContent(int eventType, XmlPullParser xpp, Condition.ConditionStageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8461    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
8462      res.setSummary(parseCodeableConcept(xpp));
8463    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessment")) {
8464      res.getAssessment().add(parseReference(xpp));
8465    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8466      res.setType(parseCodeableConcept(xpp));
8467    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8468      return false;
8469    }
8470    return true;
8471  }
8472
8473  protected Condition.ConditionEvidenceComponent parseConditionEvidenceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8474    Condition.ConditionEvidenceComponent res = new Condition.ConditionEvidenceComponent();
8475    parseElementAttributes(xpp, res);
8476    next(xpp);
8477    int eventType = nextNoWhitespace(xpp);
8478    while (eventType != XmlPullParser.END_TAG) {
8479    if (!parseConditionEvidenceComponentContent(eventType, xpp, res))
8480        unknownContent(xpp);
8481      eventType = nextNoWhitespace(xpp);
8482    }
8483    next(xpp);
8484    parseElementClose(res);
8485    return res;
8486  }
8487
8488  protected boolean parseConditionEvidenceComponentContent(int eventType, XmlPullParser xpp, Condition.ConditionEvidenceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8489    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8490      res.getCode().add(parseCodeableConcept(xpp));
8491    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
8492      res.getDetail().add(parseReference(xpp));
8493    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8494      return false;
8495    }
8496    return true;
8497  }
8498
8499  protected ConditionDefinition parseConditionDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8500    ConditionDefinition res = new ConditionDefinition();
8501    parseResourceAttributes(xpp, res);
8502    next(xpp);
8503    int eventType = nextNoWhitespace(xpp);
8504    while (eventType != XmlPullParser.END_TAG) {
8505    if (!parseConditionDefinitionContent(eventType, xpp, res))
8506        unknownContent(xpp);
8507      eventType = nextNoWhitespace(xpp);
8508    }
8509    next(xpp);
8510    parseElementClose(res);
8511    return res;
8512  }
8513
8514  protected boolean parseConditionDefinitionContent(int eventType, XmlPullParser xpp, ConditionDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
8515    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8516      res.setUrlElement(parseUri(xpp));
8517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8518      res.getIdentifier().add(parseIdentifier(xpp));
8519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
8520      res.setVersionElement(parseString(xpp));
8521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8522      res.setNameElement(parseString(xpp));
8523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
8524      res.setTitleElement(parseString(xpp));
8525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtitle")) {
8526      res.setSubtitleElement(parseString(xpp));
8527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8528      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
8529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
8530      res.setExperimentalElement(parseBoolean(xpp));
8531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {</