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 Thu, Mar 23, 2023 19:59+1100 for FHIR v5.0.0
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 Availability parseAvailability(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
552    Availability res = new Availability();
553    parseElementAttributes(xpp, res);
554    next(xpp);
555    int eventType = nextNoWhitespace(xpp);
556    while (eventType != XmlPullParser.END_TAG) {
557    if (!parseAvailabilityContent(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 parseAvailabilityContent(int eventType, XmlPullParser xpp, Availability res) throws XmlPullParserException, IOException, FHIRFormatError {
567    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableTime")) {
568      res.getAvailableTime().add(parseAvailabilityAvailableTimeComponent(xpp));
569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notAvailableTime")) {
570      res.getNotAvailableTime().add(parseAvailabilityNotAvailableTimeComponent(xpp));
571    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
572      return false;
573    }
574    return true;
575  }
576
577  protected Availability.AvailabilityAvailableTimeComponent parseAvailabilityAvailableTimeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
578    Availability.AvailabilityAvailableTimeComponent res = new Availability.AvailabilityAvailableTimeComponent();
579    parseElementAttributes(xpp, res);
580    next(xpp);
581    int eventType = nextNoWhitespace(xpp);
582    while (eventType != XmlPullParser.END_TAG) {
583    if (!parseAvailabilityAvailableTimeComponentContent(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 parseAvailabilityAvailableTimeComponentContent(int eventType, XmlPullParser xpp, Availability.AvailabilityAvailableTimeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
593    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("daysOfWeek")) {
594      res.getDaysOfWeek().add(parseEnumeration(xpp, Enumerations.DaysOfWeek.NULL, new Enumerations.DaysOfWeekEnumFactory()));
595    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("allDay")) {
596      res.setAllDayElement(parseBoolean(xpp));
597    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableStartTime")) {
598      res.setAvailableStartTimeElement(parseTime(xpp));
599    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("availableEndTime")) {
600      res.setAvailableEndTimeElement(parseTime(xpp));
601    } else if (!parseElementContent(eventType, xpp, res)){ 
602      return false;
603    }
604    return true;
605  }
606
607  protected Availability.AvailabilityNotAvailableTimeComponent parseAvailabilityNotAvailableTimeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
608    Availability.AvailabilityNotAvailableTimeComponent res = new Availability.AvailabilityNotAvailableTimeComponent();
609    parseElementAttributes(xpp, res);
610    next(xpp);
611    int eventType = nextNoWhitespace(xpp);
612    while (eventType != XmlPullParser.END_TAG) {
613    if (!parseAvailabilityNotAvailableTimeComponentContent(eventType, xpp, res))
614        unknownContent(xpp);
615      eventType = nextNoWhitespace(xpp);
616    }
617    next(xpp);
618    parseElementClose(res);
619    return res;
620  }
621
622  protected boolean parseAvailabilityNotAvailableTimeComponentContent(int eventType, XmlPullParser xpp, Availability.AvailabilityNotAvailableTimeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
623    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
624      res.setDescriptionElement(parseString(xpp));
625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("during")) {
626      res.setDuring(parsePeriod(xpp));
627    } else if (!parseElementContent(eventType, xpp, res)){ 
628      return false;
629    }
630    return true;
631  }
632
633  protected CodeableConcept parseCodeableConcept(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
634    CodeableConcept res = new CodeableConcept();
635    parseElementAttributes(xpp, res);
636    next(xpp);
637    int eventType = nextNoWhitespace(xpp);
638    while (eventType != XmlPullParser.END_TAG) {
639    if (!parseCodeableConceptContent(eventType, xpp, res))
640        unknownContent(xpp);
641      eventType = nextNoWhitespace(xpp);
642    }
643    next(xpp);
644    parseElementClose(res);
645    return res;
646  }
647
648  protected boolean parseCodeableConceptContent(int eventType, XmlPullParser xpp, CodeableConcept res) throws XmlPullParserException, IOException, FHIRFormatError {
649    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coding")) {
650      res.getCoding().add(parseCoding(xpp));
651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
652      res.setTextElement(parseString(xpp));
653    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
654      return false;
655    }
656    return true;
657  }
658
659  protected CodeableReference parseCodeableReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
660    CodeableReference res = new CodeableReference();
661    parseElementAttributes(xpp, res);
662    next(xpp);
663    int eventType = nextNoWhitespace(xpp);
664    while (eventType != XmlPullParser.END_TAG) {
665    if (!parseCodeableReferenceContent(eventType, xpp, res))
666        unknownContent(xpp);
667      eventType = nextNoWhitespace(xpp);
668    }
669    next(xpp);
670    parseElementClose(res);
671    return res;
672  }
673
674  protected boolean parseCodeableReferenceContent(int eventType, XmlPullParser xpp, CodeableReference res) throws XmlPullParserException, IOException, FHIRFormatError {
675    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
676      res.setConcept(parseCodeableConcept(xpp));
677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
678      res.setReference(parseReference(xpp));
679    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
680      return false;
681    }
682    return true;
683  }
684
685  protected Coding parseCoding(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
686    Coding res = new Coding();
687    parseElementAttributes(xpp, res);
688    next(xpp);
689    int eventType = nextNoWhitespace(xpp);
690    while (eventType != XmlPullParser.END_TAG) {
691    if (!parseCodingContent(eventType, xpp, res))
692        unknownContent(xpp);
693      eventType = nextNoWhitespace(xpp);
694    }
695    next(xpp);
696    parseElementClose(res);
697    return res;
698  }
699
700  protected boolean parseCodingContent(int eventType, XmlPullParser xpp, Coding res) throws XmlPullParserException, IOException, FHIRFormatError {
701    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
702      res.setSystemElement(parseUri(xpp));
703    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
704      res.setVersionElement(parseString(xpp));
705    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
706      res.setCodeElement(parseCode(xpp));
707    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
708      res.setDisplayElement(parseString(xpp));
709    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userSelected")) {
710      res.setUserSelectedElement(parseBoolean(xpp));
711    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
712      return false;
713    }
714    return true;
715  }
716
717  protected ContactDetail parseContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
718    ContactDetail res = new ContactDetail();
719    parseElementAttributes(xpp, res);
720    next(xpp);
721    int eventType = nextNoWhitespace(xpp);
722    while (eventType != XmlPullParser.END_TAG) {
723    if (!parseContactDetailContent(eventType, xpp, res))
724        unknownContent(xpp);
725      eventType = nextNoWhitespace(xpp);
726    }
727    next(xpp);
728    parseElementClose(res);
729    return res;
730  }
731
732  protected boolean parseContactDetailContent(int eventType, XmlPullParser xpp, ContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
733    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
734      res.setNameElement(parseString(xpp));
735    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
736      res.getTelecom().add(parseContactPoint(xpp));
737    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
738      return false;
739    }
740    return true;
741  }
742
743  protected ContactPoint parseContactPoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
744    ContactPoint res = new ContactPoint();
745    parseElementAttributes(xpp, res);
746    next(xpp);
747    int eventType = nextNoWhitespace(xpp);
748    while (eventType != XmlPullParser.END_TAG) {
749    if (!parseContactPointContent(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 parseContactPointContent(int eventType, XmlPullParser xpp, ContactPoint res) throws XmlPullParserException, IOException, FHIRFormatError {
759    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
760      res.setSystemElement(parseEnumeration(xpp, ContactPoint.ContactPointSystem.NULL, new ContactPoint.ContactPointSystemEnumFactory()));
761    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
762      res.setValueElement(parseString(xpp));
763    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
764      res.setUseElement(parseEnumeration(xpp, ContactPoint.ContactPointUse.NULL, new ContactPoint.ContactPointUseEnumFactory()));
765    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
766      res.setRankElement(parsePositiveInt(xpp));
767    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
768      res.setPeriod(parsePeriod(xpp));
769    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
770      return false;
771    }
772    return true;
773  }
774
775  protected Contributor parseContributor(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
776    Contributor res = new Contributor();
777    parseElementAttributes(xpp, res);
778    next(xpp);
779    int eventType = nextNoWhitespace(xpp);
780    while (eventType != XmlPullParser.END_TAG) {
781    if (!parseContributorContent(eventType, xpp, res))
782        unknownContent(xpp);
783      eventType = nextNoWhitespace(xpp);
784    }
785    next(xpp);
786    parseElementClose(res);
787    return res;
788  }
789
790  protected boolean parseContributorContent(int eventType, XmlPullParser xpp, Contributor res) throws XmlPullParserException, IOException, FHIRFormatError {
791    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
792      res.setTypeElement(parseEnumeration(xpp, Contributor.ContributorType.NULL, new Contributor.ContributorTypeEnumFactory()));
793    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
794      res.setNameElement(parseString(xpp));
795    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
796      res.getContact().add(parseContactDetail(xpp));
797    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
798      return false;
799    }
800    return true;
801  }
802
803  protected Count parseCount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
804    Count res = new Count();
805    parseElementAttributes(xpp, res);
806    next(xpp);
807    int eventType = nextNoWhitespace(xpp);
808    while (eventType != XmlPullParser.END_TAG) {
809    if (!parseCountContent(eventType, xpp, res))
810        unknownContent(xpp);
811      eventType = nextNoWhitespace(xpp);
812    }
813    next(xpp);
814    parseElementClose(res);
815    return res;
816  }
817
818  protected boolean parseCountContent(int eventType, XmlPullParser xpp, Count res) throws XmlPullParserException, IOException, FHIRFormatError {
819    if (!parseQuantityContent(eventType, xpp, res)){ 
820      return false;
821    }
822    return true;
823  }
824
825  protected DataRequirement parseDataRequirement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
826    DataRequirement res = new DataRequirement();
827    parseElementAttributes(xpp, res);
828    next(xpp);
829    int eventType = nextNoWhitespace(xpp);
830    while (eventType != XmlPullParser.END_TAG) {
831    if (!parseDataRequirementContent(eventType, xpp, res))
832        unknownContent(xpp);
833      eventType = nextNoWhitespace(xpp);
834    }
835    next(xpp);
836    parseElementClose(res);
837    return res;
838  }
839
840  protected boolean parseDataRequirementContent(int eventType, XmlPullParser xpp, DataRequirement res) throws XmlPullParserException, IOException, FHIRFormatError {
841    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
842      res.setTypeElement(parseEnumeration(xpp, Enumerations.FHIRTypes.NULL, new Enumerations.FHIRTypesEnumFactory()));
843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
844      res.getProfile().add(parseCanonical(xpp));
845    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "subject")) {
846      res.setSubject(parseType("subject", xpp));
847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
848      res.getMustSupport().add(parseString(xpp));
849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeFilter")) {
850      res.getCodeFilter().add(parseDataRequirementCodeFilterComponent(xpp));
851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateFilter")) {
852      res.getDateFilter().add(parseDataRequirementDateFilterComponent(xpp));
853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueFilter")) {
854      res.getValueFilter().add(parseDataRequirementValueFilterComponent(xpp));
855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("limit")) {
856      res.setLimitElement(parsePositiveInt(xpp));
857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sort")) {
858      res.getSort().add(parseDataRequirementSortComponent(xpp));
859    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
860      return false;
861    }
862    return true;
863  }
864
865  protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementCodeFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
866    DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent();
867    parseElementAttributes(xpp, res);
868    next(xpp);
869    int eventType = nextNoWhitespace(xpp);
870    while (eventType != XmlPullParser.END_TAG) {
871    if (!parseDataRequirementCodeFilterComponentContent(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 parseDataRequirementCodeFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementCodeFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
881    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
882      res.setPathElement(parseString(xpp));
883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
884      res.setSearchParamElement(parseString(xpp));
885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
886      res.setValueSetElement(parseCanonical(xpp));
887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
888      res.getCode().add(parseCoding(xpp));
889    } else if (!parseElementContent(eventType, xpp, res)){ 
890      return false;
891    }
892    return true;
893  }
894
895  protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDateFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
896    DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent();
897    parseElementAttributes(xpp, res);
898    next(xpp);
899    int eventType = nextNoWhitespace(xpp);
900    while (eventType != XmlPullParser.END_TAG) {
901    if (!parseDataRequirementDateFilterComponentContent(eventType, xpp, res))
902        unknownContent(xpp);
903      eventType = nextNoWhitespace(xpp);
904    }
905    next(xpp);
906    parseElementClose(res);
907    return res;
908  }
909
910  protected boolean parseDataRequirementDateFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementDateFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
911    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
912      res.setPathElement(parseString(xpp));
913    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
914      res.setSearchParamElement(parseString(xpp));
915    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
916      res.setValue(parseType("value", xpp));
917    } else if (!parseElementContent(eventType, xpp, res)){ 
918      return false;
919    }
920    return true;
921  }
922
923  protected DataRequirement.DataRequirementValueFilterComponent parseDataRequirementValueFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
924    DataRequirement.DataRequirementValueFilterComponent res = new DataRequirement.DataRequirementValueFilterComponent();
925    parseElementAttributes(xpp, res);
926    next(xpp);
927    int eventType = nextNoWhitespace(xpp);
928    while (eventType != XmlPullParser.END_TAG) {
929    if (!parseDataRequirementValueFilterComponentContent(eventType, xpp, res))
930        unknownContent(xpp);
931      eventType = nextNoWhitespace(xpp);
932    }
933    next(xpp);
934    parseElementClose(res);
935    return res;
936  }
937
938  protected boolean parseDataRequirementValueFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementValueFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
939    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
940      res.setPathElement(parseString(xpp));
941    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
942      res.setSearchParamElement(parseString(xpp));
943    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
944      res.setComparatorElement(parseEnumeration(xpp, DataRequirement.ValueFilterComparator.NULL, new DataRequirement.ValueFilterComparatorEnumFactory()));
945    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
946      res.setValue(parseType("value", xpp));
947    } else if (!parseElementContent(eventType, xpp, res)){ 
948      return false;
949    }
950    return true;
951  }
952
953  protected DataRequirement.DataRequirementSortComponent parseDataRequirementSortComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
954    DataRequirement.DataRequirementSortComponent res = new DataRequirement.DataRequirementSortComponent();
955    parseElementAttributes(xpp, res);
956    next(xpp);
957    int eventType = nextNoWhitespace(xpp);
958    while (eventType != XmlPullParser.END_TAG) {
959    if (!parseDataRequirementSortComponentContent(eventType, xpp, res))
960        unknownContent(xpp);
961      eventType = nextNoWhitespace(xpp);
962    }
963    next(xpp);
964    parseElementClose(res);
965    return res;
966  }
967
968  protected boolean parseDataRequirementSortComponentContent(int eventType, XmlPullParser xpp, DataRequirement.DataRequirementSortComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
969    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
970      res.setPathElement(parseString(xpp));
971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("direction")) {
972      res.setDirectionElement(parseEnumeration(xpp, DataRequirement.SortDirection.NULL, new DataRequirement.SortDirectionEnumFactory()));
973    } else if (!parseElementContent(eventType, xpp, res)){ 
974      return false;
975    }
976    return true;
977  }
978
979  protected Distance parseDistance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
980    Distance res = new Distance();
981    parseElementAttributes(xpp, res);
982    next(xpp);
983    int eventType = nextNoWhitespace(xpp);
984    while (eventType != XmlPullParser.END_TAG) {
985    if (!parseDistanceContent(eventType, xpp, res))
986        unknownContent(xpp);
987      eventType = nextNoWhitespace(xpp);
988    }
989    next(xpp);
990    parseElementClose(res);
991    return res;
992  }
993
994  protected boolean parseDistanceContent(int eventType, XmlPullParser xpp, Distance res) throws XmlPullParserException, IOException, FHIRFormatError {
995    if (!parseQuantityContent(eventType, xpp, res)){ 
996      return false;
997    }
998    return true;
999  }
1000
1001  protected Dosage parseDosage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1002    Dosage res = new Dosage();
1003    parseElementAttributes(xpp, res);
1004    next(xpp);
1005    int eventType = nextNoWhitespace(xpp);
1006    while (eventType != XmlPullParser.END_TAG) {
1007    if (!parseDosageContent(eventType, xpp, res))
1008        unknownContent(xpp);
1009      eventType = nextNoWhitespace(xpp);
1010    }
1011    next(xpp);
1012    parseElementClose(res);
1013    return res;
1014  }
1015
1016  protected boolean parseDosageContent(int eventType, XmlPullParser xpp, Dosage res) throws XmlPullParserException, IOException, FHIRFormatError {
1017    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
1018      res.setSequenceElement(parseInteger(xpp));
1019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1020      res.setTextElement(parseString(xpp));
1021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInstruction")) {
1022      res.getAdditionalInstruction().add(parseCodeableConcept(xpp));
1023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
1024      res.setPatientInstructionElement(parseString(xpp));
1025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timing")) {
1026      res.setTiming(parseTiming(xpp));
1027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asNeeded")) {
1028      res.setAsNeededElement(parseBoolean(xpp));
1029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asNeededFor")) {
1030      res.getAsNeededFor().add(parseCodeableConcept(xpp));
1031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
1032      res.setSite(parseCodeableConcept(xpp));
1033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
1034      res.setRoute(parseCodeableConcept(xpp));
1035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
1036      res.setMethod(parseCodeableConcept(xpp));
1037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doseAndRate")) {
1038      res.getDoseAndRate().add(parseDosageDoseAndRateComponent(xpp));
1039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerPeriod")) {
1040      res.getMaxDosePerPeriod().add(parseRatio(xpp));
1041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerAdministration")) {
1042      res.setMaxDosePerAdministration(parseQuantity(xpp));
1043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) {
1044      res.setMaxDosePerLifetime(parseQuantity(xpp));
1045    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1046      return false;
1047    }
1048    return true;
1049  }
1050
1051  protected Dosage.DosageDoseAndRateComponent parseDosageDoseAndRateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1052    Dosage.DosageDoseAndRateComponent res = new Dosage.DosageDoseAndRateComponent();
1053    parseElementAttributes(xpp, res);
1054    next(xpp);
1055    int eventType = nextNoWhitespace(xpp);
1056    while (eventType != XmlPullParser.END_TAG) {
1057    if (!parseDosageDoseAndRateComponentContent(eventType, xpp, res))
1058        unknownContent(xpp);
1059      eventType = nextNoWhitespace(xpp);
1060    }
1061    next(xpp);
1062    parseElementClose(res);
1063    return res;
1064  }
1065
1066  protected boolean parseDosageDoseAndRateComponentContent(int eventType, XmlPullParser xpp, Dosage.DosageDoseAndRateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1067    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1068      res.setType(parseCodeableConcept(xpp));
1069    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "dose")) {
1070      res.setDose(parseType("dose", xpp));
1071    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
1072      res.setRate(parseType("rate", xpp));
1073    } else if (!parseElementContent(eventType, xpp, res)){ 
1074      return false;
1075    }
1076    return true;
1077  }
1078
1079  protected Duration parseDuration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1080    Duration res = new Duration();
1081    parseElementAttributes(xpp, res);
1082    next(xpp);
1083    int eventType = nextNoWhitespace(xpp);
1084    while (eventType != XmlPullParser.END_TAG) {
1085    if (!parseDurationContent(eventType, xpp, res))
1086        unknownContent(xpp);
1087      eventType = nextNoWhitespace(xpp);
1088    }
1089    next(xpp);
1090    parseElementClose(res);
1091    return res;
1092  }
1093
1094  protected boolean parseDurationContent(int eventType, XmlPullParser xpp, Duration res) throws XmlPullParserException, IOException, FHIRFormatError {
1095    if (!parseQuantityContent(eventType, xpp, res)){ 
1096      return false;
1097    }
1098    return true;
1099  }
1100
1101  protected ElementDefinition parseElementDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1102    ElementDefinition res = new ElementDefinition();
1103    parseElementAttributes(xpp, res);
1104    next(xpp);
1105    int eventType = nextNoWhitespace(xpp);
1106    while (eventType != XmlPullParser.END_TAG) {
1107    if (!parseElementDefinitionContent(eventType, xpp, res))
1108        unknownContent(xpp);
1109      eventType = nextNoWhitespace(xpp);
1110    }
1111    next(xpp);
1112    parseElementClose(res);
1113    return res;
1114  }
1115
1116  protected boolean parseElementDefinitionContent(int eventType, XmlPullParser xpp, ElementDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1117    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1118      res.setPathElement(parseString(xpp));
1119    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("representation")) {
1120      res.getRepresentation().add(parseEnumeration(xpp, ElementDefinition.PropertyRepresentation.NULL, new ElementDefinition.PropertyRepresentationEnumFactory()));
1121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
1122      res.setSliceNameElement(parseString(xpp));
1123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceIsConstraining")) {
1124      res.setSliceIsConstrainingElement(parseBoolean(xpp));
1125    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1126      res.setLabelElement(parseString(xpp));
1127    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1128      res.getCode().add(parseCoding(xpp));
1129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slicing")) {
1130      res.setSlicing(parseElementDefinitionSlicingComponent(xpp));
1131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("short")) {
1132      res.setShortElement(parseString(xpp));
1133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
1134      res.setDefinitionElement(parseMarkdown(xpp));
1135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1136      res.setCommentElement(parseMarkdown(xpp));
1137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1138      res.setRequirementsElement(parseMarkdown(xpp));
1139    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
1140      res.getAlias().add(parseString(xpp));
1141    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1142      res.setMinElement(parseUnsignedInt(xpp));
1143    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1144      res.setMaxElement(parseString(xpp));
1145    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
1146      res.setBase(parseElementDefinitionBaseComponent(xpp));
1147    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentReference")) {
1148      res.setContentReferenceElement(parseUri(xpp));
1149    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1150      res.getType().add(parseElementDefinitionTypeRefComponent(xpp));
1151    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
1152      res.setDefaultValue(parseType("defaultValue", xpp));
1153    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaningWhenMissing")) {
1154      res.setMeaningWhenMissingElement(parseMarkdown(xpp));
1155    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderMeaning")) {
1156      res.setOrderMeaningElement(parseString(xpp));
1157    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "fixed")) {
1158      res.setFixed(parseType("fixed", xpp));
1159    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "pattern")) {
1160      res.setPattern(parseType("pattern", xpp));
1161    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
1162      res.getExample().add(parseElementDefinitionExampleComponent(xpp));
1163    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "minValue")) {
1164      res.setMinValue(parseType("minValue", xpp));
1165    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "maxValue")) {
1166      res.setMaxValue(parseType("maxValue", xpp));
1167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
1168      res.setMaxLengthElement(parseInteger(xpp));
1169    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
1170      res.getCondition().add(parseId(xpp));
1171    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("constraint")) {
1172      res.getConstraint().add(parseElementDefinitionConstraintComponent(xpp));
1173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustHaveValue")) {
1174      res.setMustHaveValueElement(parseBoolean(xpp));
1175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueAlternatives")) {
1176      res.getValueAlternatives().add(parseCanonical(xpp));
1177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1178      res.setMustSupportElement(parseBoolean(xpp));
1179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifier")) {
1180      res.setIsModifierElement(parseBoolean(xpp));
1181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifierReason")) {
1182      res.setIsModifierReasonElement(parseString(xpp));
1183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isSummary")) {
1184      res.setIsSummaryElement(parseBoolean(xpp));
1185    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
1186      res.setBinding(parseElementDefinitionBindingComponent(xpp));
1187    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
1188      res.getMapping().add(parseElementDefinitionMappingComponent(xpp));
1189    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1190      return false;
1191    }
1192    return true;
1193  }
1194
1195  protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionSlicingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1196    ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent();
1197    parseElementAttributes(xpp, res);
1198    next(xpp);
1199    int eventType = nextNoWhitespace(xpp);
1200    while (eventType != XmlPullParser.END_TAG) {
1201    if (!parseElementDefinitionSlicingComponentContent(eventType, xpp, res))
1202        unknownContent(xpp);
1203      eventType = nextNoWhitespace(xpp);
1204    }
1205    next(xpp);
1206    parseElementClose(res);
1207    return res;
1208  }
1209
1210  protected boolean parseElementDefinitionSlicingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionSlicingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1211    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("discriminator")) {
1212      res.getDiscriminator().add(parseElementDefinitionSlicingDiscriminatorComponent(xpp));
1213    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1214      res.setDescriptionElement(parseString(xpp));
1215    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ordered")) {
1216      res.setOrderedElement(parseBoolean(xpp));
1217    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rules")) {
1218      res.setRulesElement(parseEnumeration(xpp, ElementDefinition.SlicingRules.NULL, new ElementDefinition.SlicingRulesEnumFactory()));
1219    } else if (!parseElementContent(eventType, xpp, res)){ 
1220      return false;
1221    }
1222    return true;
1223  }
1224
1225  protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionSlicingDiscriminatorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1226    ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
1227    parseElementAttributes(xpp, res);
1228    next(xpp);
1229    int eventType = nextNoWhitespace(xpp);
1230    while (eventType != XmlPullParser.END_TAG) {
1231    if (!parseElementDefinitionSlicingDiscriminatorComponentContent(eventType, xpp, res))
1232        unknownContent(xpp);
1233      eventType = nextNoWhitespace(xpp);
1234    }
1235    next(xpp);
1236    parseElementClose(res);
1237    return res;
1238  }
1239
1240  protected boolean parseElementDefinitionSlicingDiscriminatorComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1241    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1242      res.setTypeElement(parseEnumeration(xpp, ElementDefinition.DiscriminatorType.NULL, new ElementDefinition.DiscriminatorTypeEnumFactory()));
1243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1244      res.setPathElement(parseString(xpp));
1245    } else if (!parseElementContent(eventType, xpp, res)){ 
1246      return false;
1247    }
1248    return true;
1249  }
1250
1251  protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionBaseComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1252    ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent();
1253    parseElementAttributes(xpp, res);
1254    next(xpp);
1255    int eventType = nextNoWhitespace(xpp);
1256    while (eventType != XmlPullParser.END_TAG) {
1257    if (!parseElementDefinitionBaseComponentContent(eventType, xpp, res))
1258        unknownContent(xpp);
1259      eventType = nextNoWhitespace(xpp);
1260    }
1261    next(xpp);
1262    parseElementClose(res);
1263    return res;
1264  }
1265
1266  protected boolean parseElementDefinitionBaseComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionBaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1267    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1268      res.setPathElement(parseString(xpp));
1269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1270      res.setMinElement(parseUnsignedInt(xpp));
1271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1272      res.setMaxElement(parseString(xpp));
1273    } else if (!parseElementContent(eventType, xpp, res)){ 
1274      return false;
1275    }
1276    return true;
1277  }
1278
1279  protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1280    ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent();
1281    parseElementAttributes(xpp, res);
1282    next(xpp);
1283    int eventType = nextNoWhitespace(xpp);
1284    while (eventType != XmlPullParser.END_TAG) {
1285    if (!parseElementDefinitionTypeRefComponentContent(eventType, xpp, res))
1286        unknownContent(xpp);
1287      eventType = nextNoWhitespace(xpp);
1288    }
1289    next(xpp);
1290    parseElementClose(res);
1291    return res;
1292  }
1293
1294  protected boolean parseElementDefinitionTypeRefComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.TypeRefComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1295    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1296      res.setCodeElement(parseUri(xpp));
1297    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1298      res.getProfile().add(parseCanonical(xpp));
1299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetProfile")) {
1300      res.getTargetProfile().add(parseCanonical(xpp));
1301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregation")) {
1302      res.getAggregation().add(parseEnumeration(xpp, ElementDefinition.AggregationMode.NULL, new ElementDefinition.AggregationModeEnumFactory()));
1303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
1304      res.setVersioningElement(parseEnumeration(xpp, ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory()));
1305    } else if (!parseElementContent(eventType, xpp, res)){ 
1306      return false;
1307    }
1308    return true;
1309  }
1310
1311  protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionExampleComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1312    ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent();
1313    parseElementAttributes(xpp, res);
1314    next(xpp);
1315    int eventType = nextNoWhitespace(xpp);
1316    while (eventType != XmlPullParser.END_TAG) {
1317    if (!parseElementDefinitionExampleComponentContent(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 parseElementDefinitionExampleComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionExampleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1327    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1328      res.setLabelElement(parseString(xpp));
1329    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1330      res.setValue(parseType("value", xpp));
1331    } else if (!parseElementContent(eventType, xpp, res)){ 
1332      return false;
1333    }
1334    return true;
1335  }
1336
1337  protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionConstraintComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1338    ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent();
1339    parseElementAttributes(xpp, res);
1340    next(xpp);
1341    int eventType = nextNoWhitespace(xpp);
1342    while (eventType != XmlPullParser.END_TAG) {
1343    if (!parseElementDefinitionConstraintComponentContent(eventType, xpp, res))
1344        unknownContent(xpp);
1345      eventType = nextNoWhitespace(xpp);
1346    }
1347    next(xpp);
1348    parseElementClose(res);
1349    return res;
1350  }
1351
1352  protected boolean parseElementDefinitionConstraintComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionConstraintComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1353    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("key")) {
1354      res.setKeyElement(parseId(xpp));
1355    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1356      res.setRequirementsElement(parseMarkdown(xpp));
1357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
1358      res.setSeverityElement(parseEnumeration(xpp, ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory()));
1359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suppress")) {
1360      res.setSuppressElement(parseBoolean(xpp));
1361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("human")) {
1362      res.setHumanElement(parseString(xpp));
1363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1364      res.setExpressionElement(parseString(xpp));
1365    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1366      res.setSourceElement(parseCanonical(xpp));
1367    } else if (!parseElementContent(eventType, xpp, res)){ 
1368      return false;
1369    }
1370    return true;
1371  }
1372
1373  protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionBindingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1374    ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent();
1375    parseElementAttributes(xpp, res);
1376    next(xpp);
1377    int eventType = nextNoWhitespace(xpp);
1378    while (eventType != XmlPullParser.END_TAG) {
1379    if (!parseElementDefinitionBindingComponentContent(eventType, xpp, res))
1380        unknownContent(xpp);
1381      eventType = nextNoWhitespace(xpp);
1382    }
1383    next(xpp);
1384    parseElementClose(res);
1385    return res;
1386  }
1387
1388  protected boolean parseElementDefinitionBindingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1389    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
1390      res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
1391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1392      res.setDescriptionElement(parseMarkdown(xpp));
1393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
1394      res.setValueSetElement(parseCanonical(xpp));
1395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additional")) {
1396      res.getAdditional().add(parseElementDefinitionBindingAdditionalComponent(xpp));
1397    } else if (!parseElementContent(eventType, xpp, res)){ 
1398      return false;
1399    }
1400    return true;
1401  }
1402
1403  protected ElementDefinition.ElementDefinitionBindingAdditionalComponent parseElementDefinitionBindingAdditionalComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1404    ElementDefinition.ElementDefinitionBindingAdditionalComponent res = new ElementDefinition.ElementDefinitionBindingAdditionalComponent();
1405    parseElementAttributes(xpp, res);
1406    next(xpp);
1407    int eventType = nextNoWhitespace(xpp);
1408    while (eventType != XmlPullParser.END_TAG) {
1409    if (!parseElementDefinitionBindingAdditionalComponentContent(eventType, xpp, res))
1410        unknownContent(xpp);
1411      eventType = nextNoWhitespace(xpp);
1412    }
1413    next(xpp);
1414    parseElementClose(res);
1415    return res;
1416  }
1417
1418  protected boolean parseElementDefinitionBindingAdditionalComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionBindingAdditionalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1419    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
1420      res.setPurposeElement(parseEnumeration(xpp, ElementDefinition.AdditionalBindingPurposeVS.NULL, new ElementDefinition.AdditionalBindingPurposeVSEnumFactory()));
1421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
1422      res.setValueSetElement(parseCanonical(xpp));
1423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1424      res.setDocumentationElement(parseMarkdown(xpp));
1425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("shortDoco")) {
1426      res.setShortDocoElement(parseString(xpp));
1427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
1428      res.getUsage().add(parseUsageContext(xpp));
1429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("any")) {
1430      res.setAnyElement(parseBoolean(xpp));
1431    } else if (!parseElementContent(eventType, xpp, res)){ 
1432      return false;
1433    }
1434    return true;
1435  }
1436
1437  protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionMappingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1438    ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent();
1439    parseElementAttributes(xpp, res);
1440    next(xpp);
1441    int eventType = nextNoWhitespace(xpp);
1442    while (eventType != XmlPullParser.END_TAG) {
1443    if (!parseElementDefinitionMappingComponentContent(eventType, xpp, res))
1444        unknownContent(xpp);
1445      eventType = nextNoWhitespace(xpp);
1446    }
1447    next(xpp);
1448    parseElementClose(res);
1449    return res;
1450  }
1451
1452  protected boolean parseElementDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition.ElementDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1453    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
1454      res.setIdentityElement(parseId(xpp));
1455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1456      res.setLanguageElement(parseCode(xpp));
1457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("map")) {
1458      res.setMapElement(parseString(xpp));
1459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1460      res.setCommentElement(parseMarkdown(xpp));
1461    } else if (!parseElementContent(eventType, xpp, res)){ 
1462      return false;
1463    }
1464    return true;
1465  }
1466
1467  protected Expression parseExpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1468    Expression res = new Expression();
1469    parseElementAttributes(xpp, res);
1470    next(xpp);
1471    int eventType = nextNoWhitespace(xpp);
1472    while (eventType != XmlPullParser.END_TAG) {
1473    if (!parseExpressionContent(eventType, xpp, res))
1474        unknownContent(xpp);
1475      eventType = nextNoWhitespace(xpp);
1476    }
1477    next(xpp);
1478    parseElementClose(res);
1479    return res;
1480  }
1481
1482  protected boolean parseExpressionContent(int eventType, XmlPullParser xpp, Expression res) throws XmlPullParserException, IOException, FHIRFormatError {
1483    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1484      res.setDescriptionElement(parseString(xpp));
1485    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1486      res.setNameElement(parseCode(xpp));
1487    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1488      res.setLanguageElement(parseCode(xpp));
1489    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1490      res.setExpressionElement(parseString(xpp));
1491    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
1492      res.setReferenceElement(parseUri(xpp));
1493    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1494      return false;
1495    }
1496    return true;
1497  }
1498
1499  protected ExtendedContactDetail parseExtendedContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1500    ExtendedContactDetail res = new ExtendedContactDetail();
1501    parseElementAttributes(xpp, res);
1502    next(xpp);
1503    int eventType = nextNoWhitespace(xpp);
1504    while (eventType != XmlPullParser.END_TAG) {
1505    if (!parseExtendedContactDetailContent(eventType, xpp, res))
1506        unknownContent(xpp);
1507      eventType = nextNoWhitespace(xpp);
1508    }
1509    next(xpp);
1510    parseElementClose(res);
1511    return res;
1512  }
1513
1514  protected boolean parseExtendedContactDetailContent(int eventType, XmlPullParser xpp, ExtendedContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
1515    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
1516      res.setPurpose(parseCodeableConcept(xpp));
1517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1518      res.getName().add(parseHumanName(xpp));
1519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
1520      res.getTelecom().add(parseContactPoint(xpp));
1521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
1522      res.setAddress(parseAddress(xpp));
1523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
1524      res.setOrganization(parseReference(xpp));
1525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1526      res.setPeriod(parsePeriod(xpp));
1527    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1528      return false;
1529    }
1530    return true;
1531  }
1532
1533  protected Extension parseExtension(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1534    Extension res = new Extension();
1535    parseElementAttributes(xpp, res);
1536    if (xpp.getAttributeValue(null, "url") != null)
1537        res.setUrl(xpp.getAttributeValue(null, "url"));
1538    next(xpp);
1539    int eventType = nextNoWhitespace(xpp);
1540    while (eventType != XmlPullParser.END_TAG) {
1541    if (!parseExtensionContent(eventType, xpp, res))
1542        unknownContent(xpp);
1543      eventType = nextNoWhitespace(xpp);
1544    }
1545    next(xpp);
1546    parseElementClose(res);
1547    return res;
1548  }
1549
1550  protected boolean parseExtensionContent(int eventType, XmlPullParser xpp, Extension res) throws XmlPullParserException, IOException, FHIRFormatError {
1551    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1552      res.setValue(parseType("value", xpp));
1553    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1554      return false;
1555    }
1556    return true;
1557  }
1558
1559  protected HumanName parseHumanName(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1560    HumanName res = new HumanName();
1561    parseElementAttributes(xpp, res);
1562    next(xpp);
1563    int eventType = nextNoWhitespace(xpp);
1564    while (eventType != XmlPullParser.END_TAG) {
1565    if (!parseHumanNameContent(eventType, xpp, res))
1566        unknownContent(xpp);
1567      eventType = nextNoWhitespace(xpp);
1568    }
1569    next(xpp);
1570    parseElementClose(res);
1571    return res;
1572  }
1573
1574  protected boolean parseHumanNameContent(int eventType, XmlPullParser xpp, HumanName res) throws XmlPullParserException, IOException, FHIRFormatError {
1575    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1576      res.setUseElement(parseEnumeration(xpp, HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory()));
1577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1578      res.setTextElement(parseString(xpp));
1579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("family")) {
1580      res.setFamilyElement(parseString(xpp));
1581    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("given")) {
1582      res.getGiven().add(parseString(xpp));
1583    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
1584      res.getPrefix().add(parseString(xpp));
1585    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suffix")) {
1586      res.getSuffix().add(parseString(xpp));
1587    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1588      res.setPeriod(parsePeriod(xpp));
1589    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1590      return false;
1591    }
1592    return true;
1593  }
1594
1595  protected Identifier parseIdentifier(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1596    Identifier res = new Identifier();
1597    parseElementAttributes(xpp, res);
1598    next(xpp);
1599    int eventType = nextNoWhitespace(xpp);
1600    while (eventType != XmlPullParser.END_TAG) {
1601    if (!parseIdentifierContent(eventType, xpp, res))
1602        unknownContent(xpp);
1603      eventType = nextNoWhitespace(xpp);
1604    }
1605    next(xpp);
1606    parseElementClose(res);
1607    return res;
1608  }
1609
1610  protected boolean parseIdentifierContent(int eventType, XmlPullParser xpp, Identifier res) throws XmlPullParserException, IOException, FHIRFormatError {
1611    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1612      res.setUseElement(parseEnumeration(xpp, Identifier.IdentifierUse.NULL, new Identifier.IdentifierUseEnumFactory()));
1613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1614      res.setType(parseCodeableConcept(xpp));
1615    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1616      res.setSystemElement(parseUri(xpp));
1617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1618      res.setValueElement(parseString(xpp));
1619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1620      res.setPeriod(parsePeriod(xpp));
1621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assigner")) {
1622      res.setAssigner(parseReference(xpp));
1623    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1624      return false;
1625    }
1626    return true;
1627  }
1628
1629  protected MarketingStatus parseMarketingStatus(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1630    MarketingStatus res = new MarketingStatus();
1631    parseElementAttributes(xpp, res);
1632    next(xpp);
1633    int eventType = nextNoWhitespace(xpp);
1634    while (eventType != XmlPullParser.END_TAG) {
1635    if (!parseMarketingStatusContent(eventType, xpp, res))
1636        unknownContent(xpp);
1637      eventType = nextNoWhitespace(xpp);
1638    }
1639    next(xpp);
1640    parseElementClose(res);
1641    return res;
1642  }
1643
1644  protected boolean parseMarketingStatusContent(int eventType, XmlPullParser xpp, MarketingStatus res) throws XmlPullParserException, IOException, FHIRFormatError {
1645    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
1646      res.setCountry(parseCodeableConcept(xpp));
1647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
1648      res.setJurisdiction(parseCodeableConcept(xpp));
1649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1650      res.setStatus(parseCodeableConcept(xpp));
1651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateRange")) {
1652      res.setDateRange(parsePeriod(xpp));
1653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("restoreDate")) {
1654      res.setRestoreDateElement(parseDateTime(xpp));
1655    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1656      return false;
1657    }
1658    return true;
1659  }
1660
1661  protected Meta parseMeta(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1662    Meta res = new Meta();
1663    parseElementAttributes(xpp, res);
1664    next(xpp);
1665    int eventType = nextNoWhitespace(xpp);
1666    while (eventType != XmlPullParser.END_TAG) {
1667    if (!parseMetaContent(eventType, xpp, res))
1668        unknownContent(xpp);
1669      eventType = nextNoWhitespace(xpp);
1670    }
1671    next(xpp);
1672    parseElementClose(res);
1673    return res;
1674  }
1675
1676  protected boolean parseMetaContent(int eventType, XmlPullParser xpp, Meta res) throws XmlPullParserException, IOException, FHIRFormatError {
1677    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionId")) {
1678      res.setVersionIdElement(parseId(xpp));
1679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastUpdated")) {
1680      res.setLastUpdatedElement(parseInstant(xpp));
1681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1682      res.setSourceElement(parseUri(xpp));
1683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1684      res.getProfile().add(parseCanonical(xpp));
1685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
1686      res.getSecurity().add(parseCoding(xpp));
1687    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
1688      res.getTag().add(parseCoding(xpp));
1689    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1690      return false;
1691    }
1692    return true;
1693  }
1694
1695  protected MonetaryComponent parseMonetaryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1696    MonetaryComponent res = new MonetaryComponent();
1697    parseElementAttributes(xpp, res);
1698    next(xpp);
1699    int eventType = nextNoWhitespace(xpp);
1700    while (eventType != XmlPullParser.END_TAG) {
1701    if (!parseMonetaryComponentContent(eventType, xpp, res))
1702        unknownContent(xpp);
1703      eventType = nextNoWhitespace(xpp);
1704    }
1705    next(xpp);
1706    parseElementClose(res);
1707    return res;
1708  }
1709
1710  protected boolean parseMonetaryComponentContent(int eventType, XmlPullParser xpp, MonetaryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1711    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1712      res.setTypeElement(parseEnumeration(xpp, MonetaryComponent.PriceComponentType.NULL, new MonetaryComponent.PriceComponentTypeEnumFactory()));
1713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1714      res.setCode(parseCodeableConcept(xpp));
1715    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
1716      res.setFactorElement(parseDecimal(xpp));
1717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
1718      res.setAmount(parseMoney(xpp));
1719    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1720      return false;
1721    }
1722    return true;
1723  }
1724
1725  protected Money parseMoney(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1726    Money res = new Money();
1727    parseElementAttributes(xpp, res);
1728    next(xpp);
1729    int eventType = nextNoWhitespace(xpp);
1730    while (eventType != XmlPullParser.END_TAG) {
1731    if (!parseMoneyContent(eventType, xpp, res))
1732        unknownContent(xpp);
1733      eventType = nextNoWhitespace(xpp);
1734    }
1735    next(xpp);
1736    parseElementClose(res);
1737    return res;
1738  }
1739
1740  protected boolean parseMoneyContent(int eventType, XmlPullParser xpp, Money res) throws XmlPullParserException, IOException, FHIRFormatError {
1741    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1742      res.setValueElement(parseDecimal(xpp));
1743    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currency")) {
1744      res.setCurrencyElement(parseCode(xpp));
1745    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1746      return false;
1747    }
1748    return true;
1749  }
1750
1751  protected Narrative parseNarrative(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1752    Narrative res = new Narrative();
1753    parseElementAttributes(xpp, res);
1754    next(xpp);
1755    int eventType = nextNoWhitespace(xpp);
1756    while (eventType != XmlPullParser.END_TAG) {
1757    if (!parseNarrativeContent(eventType, xpp, res))
1758        unknownContent(xpp);
1759      eventType = nextNoWhitespace(xpp);
1760    }
1761    next(xpp);
1762    parseElementClose(res);
1763    return res;
1764  }
1765
1766  protected boolean parseNarrativeContent(int eventType, XmlPullParser xpp, Narrative res) throws XmlPullParserException, IOException, FHIRFormatError {
1767    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1768      res.setStatusElement(parseEnumeration(xpp, Narrative.NarrativeStatus.NULL, new Narrative.NarrativeStatusEnumFactory()));
1769    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("div")) {
1770      res.setDiv(parseXhtml(xpp));
1771    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1772      return false;
1773    }
1774    return true;
1775  }
1776
1777  protected ParameterDefinition parseParameterDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1778    ParameterDefinition res = new ParameterDefinition();
1779    parseElementAttributes(xpp, res);
1780    next(xpp);
1781    int eventType = nextNoWhitespace(xpp);
1782    while (eventType != XmlPullParser.END_TAG) {
1783    if (!parseParameterDefinitionContent(eventType, xpp, res))
1784        unknownContent(xpp);
1785      eventType = nextNoWhitespace(xpp);
1786    }
1787    next(xpp);
1788    parseElementClose(res);
1789    return res;
1790  }
1791
1792  protected boolean parseParameterDefinitionContent(int eventType, XmlPullParser xpp, ParameterDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1793    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1794      res.setNameElement(parseCode(xpp));
1795    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1796      res.setUseElement(parseEnumeration(xpp, Enumerations.OperationParameterUse.NULL, new Enumerations.OperationParameterUseEnumFactory()));
1797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1798      res.setMinElement(parseInteger(xpp));
1799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1800      res.setMaxElement(parseString(xpp));
1801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1802      res.setDocumentationElement(parseString(xpp));
1803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1804      res.setTypeElement(parseEnumeration(xpp, Enumerations.FHIRTypes.NULL, new Enumerations.FHIRTypesEnumFactory()));
1805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1806      res.setProfileElement(parseCanonical(xpp));
1807    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1808      return false;
1809    }
1810    return true;
1811  }
1812
1813  protected Period parsePeriod(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1814    Period res = new Period();
1815    parseElementAttributes(xpp, res);
1816    next(xpp);
1817    int eventType = nextNoWhitespace(xpp);
1818    while (eventType != XmlPullParser.END_TAG) {
1819    if (!parsePeriodContent(eventType, xpp, res))
1820        unknownContent(xpp);
1821      eventType = nextNoWhitespace(xpp);
1822    }
1823    next(xpp);
1824    parseElementClose(res);
1825    return res;
1826  }
1827
1828  protected boolean parsePeriodContent(int eventType, XmlPullParser xpp, Period res) throws XmlPullParserException, IOException, FHIRFormatError {
1829    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
1830      res.setStartElement(parseDateTime(xpp));
1831    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
1832      res.setEndElement(parseDateTime(xpp));
1833    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1834      return false;
1835    }
1836    return true;
1837  }
1838
1839  protected ProductShelfLife parseProductShelfLife(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1840    ProductShelfLife res = new ProductShelfLife();
1841    parseElementAttributes(xpp, res);
1842    next(xpp);
1843    int eventType = nextNoWhitespace(xpp);
1844    while (eventType != XmlPullParser.END_TAG) {
1845    if (!parseProductShelfLifeContent(eventType, xpp, res))
1846        unknownContent(xpp);
1847      eventType = nextNoWhitespace(xpp);
1848    }
1849    next(xpp);
1850    parseElementClose(res);
1851    return res;
1852  }
1853
1854  protected boolean parseProductShelfLifeContent(int eventType, XmlPullParser xpp, ProductShelfLife res) throws XmlPullParserException, IOException, FHIRFormatError {
1855    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1856      res.setType(parseCodeableConcept(xpp));
1857    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "period")) {
1858      res.setPeriod(parseType("period", xpp));
1859    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialPrecautionsForStorage")) {
1860      res.getSpecialPrecautionsForStorage().add(parseCodeableConcept(xpp));
1861    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
1862      return false;
1863    }
1864    return true;
1865  }
1866
1867  protected Quantity parseQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1868    Quantity res = new Quantity();
1869    parseElementAttributes(xpp, res);
1870    next(xpp);
1871    int eventType = nextNoWhitespace(xpp);
1872    while (eventType != XmlPullParser.END_TAG) {
1873    if (!parseQuantityContent(eventType, xpp, res))
1874        unknownContent(xpp);
1875      eventType = nextNoWhitespace(xpp);
1876    }
1877    next(xpp);
1878    parseElementClose(res);
1879    return res;
1880  }
1881
1882  protected boolean parseQuantityContent(int eventType, XmlPullParser xpp, Quantity res) throws XmlPullParserException, IOException, FHIRFormatError {
1883    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1884      res.setValueElement(parseDecimal(xpp));
1885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
1886      res.setComparatorElement(parseEnumeration(xpp, Enumerations.QuantityComparator.NULL, new Enumerations.QuantityComparatorEnumFactory()));
1887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
1888      res.setUnitElement(parseString(xpp));
1889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1890      res.setSystemElement(parseUri(xpp));
1891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1892      res.setCodeElement(parseCode(xpp));
1893    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1894      return false;
1895    }
1896    return true;
1897  }
1898
1899  protected Range parseRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1900    Range res = new Range();
1901    parseElementAttributes(xpp, res);
1902    next(xpp);
1903    int eventType = nextNoWhitespace(xpp);
1904    while (eventType != XmlPullParser.END_TAG) {
1905    if (!parseRangeContent(eventType, xpp, res))
1906        unknownContent(xpp);
1907      eventType = nextNoWhitespace(xpp);
1908    }
1909    next(xpp);
1910    parseElementClose(res);
1911    return res;
1912  }
1913
1914  protected boolean parseRangeContent(int eventType, XmlPullParser xpp, Range res) throws XmlPullParserException, IOException, FHIRFormatError {
1915    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
1916      res.setLow(parseQuantity(xpp));
1917    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
1918      res.setHigh(parseQuantity(xpp));
1919    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1920      return false;
1921    }
1922    return true;
1923  }
1924
1925  protected Ratio parseRatio(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1926    Ratio res = new Ratio();
1927    parseElementAttributes(xpp, res);
1928    next(xpp);
1929    int eventType = nextNoWhitespace(xpp);
1930    while (eventType != XmlPullParser.END_TAG) {
1931    if (!parseRatioContent(eventType, xpp, res))
1932        unknownContent(xpp);
1933      eventType = nextNoWhitespace(xpp);
1934    }
1935    next(xpp);
1936    parseElementClose(res);
1937    return res;
1938  }
1939
1940  protected boolean parseRatioContent(int eventType, XmlPullParser xpp, Ratio res) throws XmlPullParserException, IOException, FHIRFormatError {
1941    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numerator")) {
1942      res.setNumerator(parseQuantity(xpp));
1943    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
1944      res.setDenominator(parseQuantity(xpp));
1945    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1946      return false;
1947    }
1948    return true;
1949  }
1950
1951  protected RatioRange parseRatioRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1952    RatioRange res = new RatioRange();
1953    parseElementAttributes(xpp, res);
1954    next(xpp);
1955    int eventType = nextNoWhitespace(xpp);
1956    while (eventType != XmlPullParser.END_TAG) {
1957    if (!parseRatioRangeContent(eventType, xpp, res))
1958        unknownContent(xpp);
1959      eventType = nextNoWhitespace(xpp);
1960    }
1961    next(xpp);
1962    parseElementClose(res);
1963    return res;
1964  }
1965
1966  protected boolean parseRatioRangeContent(int eventType, XmlPullParser xpp, RatioRange res) throws XmlPullParserException, IOException, FHIRFormatError {
1967    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowNumerator")) {
1968      res.setLowNumerator(parseQuantity(xpp));
1969    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("highNumerator")) {
1970      res.setHighNumerator(parseQuantity(xpp));
1971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
1972      res.setDenominator(parseQuantity(xpp));
1973    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
1974      return false;
1975    }
1976    return true;
1977  }
1978
1979  protected Reference parseReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1980    Reference res = new Reference();
1981    parseElementAttributes(xpp, res);
1982    next(xpp);
1983    int eventType = nextNoWhitespace(xpp);
1984    while (eventType != XmlPullParser.END_TAG) {
1985    if (!parseReferenceContent(eventType, xpp, res))
1986        unknownContent(xpp);
1987      eventType = nextNoWhitespace(xpp);
1988    }
1989    next(xpp);
1990    parseElementClose(res);
1991    return res;
1992  }
1993
1994  protected boolean parseReferenceContent(int eventType, XmlPullParser xpp, Reference res) throws XmlPullParserException, IOException, FHIRFormatError {
1995    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
1996      res.setReferenceElement(parseString(xpp));
1997    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1998      res.setTypeElement(parseUri(xpp));
1999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2000      res.setIdentifier(parseIdentifier(xpp));
2001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
2002      res.setDisplayElement(parseString(xpp));
2003    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2004      return false;
2005    }
2006    return true;
2007  }
2008
2009  protected RelatedArtifact parseRelatedArtifact(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2010    RelatedArtifact res = new RelatedArtifact();
2011    parseElementAttributes(xpp, res);
2012    next(xpp);
2013    int eventType = nextNoWhitespace(xpp);
2014    while (eventType != XmlPullParser.END_TAG) {
2015    if (!parseRelatedArtifactContent(eventType, xpp, res))
2016        unknownContent(xpp);
2017      eventType = nextNoWhitespace(xpp);
2018    }
2019    next(xpp);
2020    parseElementClose(res);
2021    return res;
2022  }
2023
2024  protected boolean parseRelatedArtifactContent(int eventType, XmlPullParser xpp, RelatedArtifact res) throws XmlPullParserException, IOException, FHIRFormatError {
2025    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2026      res.setTypeElement(parseEnumeration(xpp, RelatedArtifact.RelatedArtifactType.NULL, new RelatedArtifact.RelatedArtifactTypeEnumFactory()));
2027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
2028      res.getClassifier().add(parseCodeableConcept(xpp));
2029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
2030      res.setLabelElement(parseString(xpp));
2031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
2032      res.setDisplayElement(parseString(xpp));
2033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
2034      res.setCitationElement(parseMarkdown(xpp));
2035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
2036      res.setDocument(parseAttachment(xpp));
2037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2038      res.setResourceElement(parseCanonical(xpp));
2039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceReference")) {
2040      res.setResourceReference(parseReference(xpp));
2041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationStatus")) {
2042      res.setPublicationStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationDate")) {
2044      res.setPublicationDateElement(parseDate(xpp));
2045    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2046      return false;
2047    }
2048    return true;
2049  }
2050
2051  protected SampledData parseSampledData(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2052    SampledData res = new SampledData();
2053    parseElementAttributes(xpp, res);
2054    next(xpp);
2055    int eventType = nextNoWhitespace(xpp);
2056    while (eventType != XmlPullParser.END_TAG) {
2057    if (!parseSampledDataContent(eventType, xpp, res))
2058        unknownContent(xpp);
2059      eventType = nextNoWhitespace(xpp);
2060    }
2061    next(xpp);
2062    parseElementClose(res);
2063    return res;
2064  }
2065
2066  protected boolean parseSampledDataContent(int eventType, XmlPullParser xpp, SampledData res) throws XmlPullParserException, IOException, FHIRFormatError {
2067    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
2068      res.setOrigin(parseQuantity(xpp));
2069    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interval")) {
2070      res.setIntervalElement(parseDecimal(xpp));
2071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intervalUnit")) {
2072      res.setIntervalUnitElement(parseCode(xpp));
2073    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
2074      res.setFactorElement(parseDecimal(xpp));
2075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowerLimit")) {
2076      res.setLowerLimitElement(parseDecimal(xpp));
2077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("upperLimit")) {
2078      res.setUpperLimitElement(parseDecimal(xpp));
2079    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dimensions")) {
2080      res.setDimensionsElement(parsePositiveInt(xpp));
2081    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeMap")) {
2082      res.setCodeMapElement(parseCanonical(xpp));
2083    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offsets")) {
2084      res.setOffsetsElement(parseString(xpp));
2085    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
2086      res.setDataElement(parseString(xpp));
2087    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2088      return false;
2089    }
2090    return true;
2091  }
2092
2093  protected Signature parseSignature(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2094    Signature res = new Signature();
2095    parseElementAttributes(xpp, res);
2096    next(xpp);
2097    int eventType = nextNoWhitespace(xpp);
2098    while (eventType != XmlPullParser.END_TAG) {
2099    if (!parseSignatureContent(eventType, xpp, res))
2100        unknownContent(xpp);
2101      eventType = nextNoWhitespace(xpp);
2102    }
2103    next(xpp);
2104    parseElementClose(res);
2105    return res;
2106  }
2107
2108  protected boolean parseSignatureContent(int eventType, XmlPullParser xpp, Signature res) throws XmlPullParserException, IOException, FHIRFormatError {
2109    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2110      res.getType().add(parseCoding(xpp));
2111    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
2112      res.setWhenElement(parseInstant(xpp));
2113    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("who")) {
2114      res.setWho(parseReference(xpp));
2115    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
2116      res.setOnBehalfOf(parseReference(xpp));
2117    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetFormat")) {
2118      res.setTargetFormatElement(parseCode(xpp));
2119    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sigFormat")) {
2120      res.setSigFormatElement(parseCode(xpp));
2121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
2122      res.setDataElement(parseBase64Binary(xpp));
2123    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2124      return false;
2125    }
2126    return true;
2127  }
2128
2129  protected Timing parseTiming(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2130    Timing res = new Timing();
2131    parseElementAttributes(xpp, res);
2132    next(xpp);
2133    int eventType = nextNoWhitespace(xpp);
2134    while (eventType != XmlPullParser.END_TAG) {
2135    if (!parseTimingContent(eventType, xpp, res))
2136        unknownContent(xpp);
2137      eventType = nextNoWhitespace(xpp);
2138    }
2139    next(xpp);
2140    parseElementClose(res);
2141    return res;
2142  }
2143
2144  protected boolean parseTimingContent(int eventType, XmlPullParser xpp, Timing res) throws XmlPullParserException, IOException, FHIRFormatError {
2145    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
2146      res.getEvent().add(parseDateTime(xpp));
2147    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeat")) {
2148      res.setRepeat(parseTimingRepeatComponent(xpp));
2149    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2150      res.setCode(parseCodeableConcept(xpp));
2151    } else if (!parseBackboneTypeContent(eventType, xpp, res)){ 
2152      return false;
2153    }
2154    return true;
2155  }
2156
2157  protected Timing.TimingRepeatComponent parseTimingRepeatComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2158    Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent();
2159    parseElementAttributes(xpp, res);
2160    next(xpp);
2161    int eventType = nextNoWhitespace(xpp);
2162    while (eventType != XmlPullParser.END_TAG) {
2163    if (!parseTimingRepeatComponentContent(eventType, xpp, res))
2164        unknownContent(xpp);
2165      eventType = nextNoWhitespace(xpp);
2166    }
2167    next(xpp);
2168    parseElementClose(res);
2169    return res;
2170  }
2171
2172  protected boolean parseTimingRepeatComponentContent(int eventType, XmlPullParser xpp, Timing.TimingRepeatComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2173    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "bounds")) {
2174      res.setBounds(parseType("bounds", xpp));
2175    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
2176      res.setCountElement(parsePositiveInt(xpp));
2177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("countMax")) {
2178      res.setCountMaxElement(parsePositiveInt(xpp));
2179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
2180      res.setDurationElement(parseDecimal(xpp));
2181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationMax")) {
2182      res.setDurationMaxElement(parseDecimal(xpp));
2183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationUnit")) {
2184      res.setDurationUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
2185    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequency")) {
2186      res.setFrequencyElement(parsePositiveInt(xpp));
2187    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyMax")) {
2188      res.setFrequencyMaxElement(parsePositiveInt(xpp));
2189    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
2190      res.setPeriodElement(parseDecimal(xpp));
2191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodMax")) {
2192      res.setPeriodMaxElement(parseDecimal(xpp));
2193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodUnit")) {
2194      res.setPeriodUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
2195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
2196      res.getDayOfWeek().add(parseEnumeration(xpp, Enumerations.DaysOfWeek.NULL, new Enumerations.DaysOfWeekEnumFactory()));
2197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timeOfDay")) {
2198      res.getTimeOfDay().add(parseTime(xpp));
2199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
2200      res.getWhen().add(parseEnumeration(xpp, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory()));
2201    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
2202      res.setOffsetElement(parseUnsignedInt(xpp));
2203    } else if (!parseElementContent(eventType, xpp, res)){ 
2204      return false;
2205    }
2206    return true;
2207  }
2208
2209  protected TriggerDefinition parseTriggerDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2210    TriggerDefinition res = new TriggerDefinition();
2211    parseElementAttributes(xpp, res);
2212    next(xpp);
2213    int eventType = nextNoWhitespace(xpp);
2214    while (eventType != XmlPullParser.END_TAG) {
2215    if (!parseTriggerDefinitionContent(eventType, xpp, res))
2216        unknownContent(xpp);
2217      eventType = nextNoWhitespace(xpp);
2218    }
2219    next(xpp);
2220    parseElementClose(res);
2221    return res;
2222  }
2223
2224  protected boolean parseTriggerDefinitionContent(int eventType, XmlPullParser xpp, TriggerDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2225    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2226      res.setTypeElement(parseEnumeration(xpp, TriggerDefinition.TriggerType.NULL, new TriggerDefinition.TriggerTypeEnumFactory()));
2227    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2228      res.setNameElement(parseString(xpp));
2229    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2230      res.setCode(parseCodeableConcept(xpp));
2231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriptionTopic")) {
2232      res.setSubscriptionTopicElement(parseCanonical(xpp));
2233    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
2234      res.setTiming(parseType("timing", xpp));
2235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
2236      res.getData().add(parseDataRequirement(xpp));
2237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
2238      res.setCondition(parseExpression(xpp));
2239    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2240      return false;
2241    }
2242    return true;
2243  }
2244
2245  protected UsageContext parseUsageContext(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2246    UsageContext res = new UsageContext();
2247    parseElementAttributes(xpp, res);
2248    next(xpp);
2249    int eventType = nextNoWhitespace(xpp);
2250    while (eventType != XmlPullParser.END_TAG) {
2251    if (!parseUsageContextContent(eventType, xpp, res))
2252        unknownContent(xpp);
2253      eventType = nextNoWhitespace(xpp);
2254    }
2255    next(xpp);
2256    parseElementClose(res);
2257    return res;
2258  }
2259
2260  protected boolean parseUsageContextContent(int eventType, XmlPullParser xpp, UsageContext res) throws XmlPullParserException, IOException, FHIRFormatError {
2261    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2262      res.setCode(parseCoding(xpp));
2263    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
2264      res.setValue(parseType("value", xpp));
2265    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2266      return false;
2267    }
2268    return true;
2269  }
2270
2271  protected VirtualServiceDetail parseVirtualServiceDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2272    VirtualServiceDetail res = new VirtualServiceDetail();
2273    parseElementAttributes(xpp, res);
2274    next(xpp);
2275    int eventType = nextNoWhitespace(xpp);
2276    while (eventType != XmlPullParser.END_TAG) {
2277    if (!parseVirtualServiceDetailContent(eventType, xpp, res))
2278        unknownContent(xpp);
2279      eventType = nextNoWhitespace(xpp);
2280    }
2281    next(xpp);
2282    parseElementClose(res);
2283    return res;
2284  }
2285
2286  protected boolean parseVirtualServiceDetailContent(int eventType, XmlPullParser xpp, VirtualServiceDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
2287    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("channelType")) {
2288      res.setChannelType(parseCoding(xpp));
2289    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "address")) {
2290      res.setAddress(parseType("address", xpp));
2291    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInfo")) {
2292      res.getAdditionalInfo().add(parseUrl(xpp));
2293    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxParticipants")) {
2294      res.setMaxParticipantsElement(parsePositiveInt(xpp));
2295    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sessionKey")) {
2296      res.setSessionKeyElement(parseString(xpp));
2297    } else if (!parseDataTypeContent(eventType, xpp, res)){ 
2298      return false;
2299    }
2300    return true;
2301  }
2302
2303  protected boolean parseCanonicalResourceContent(int eventType, XmlPullParser xpp, CanonicalResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2304    if (!parseDomainResourceContent(eventType, xpp, res)){ 
2305        return false;
2306    }
2307    return true;
2308  }
2309
2310  protected boolean parseDomainResourceContent(int eventType, XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2311    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
2312      res.setText(parseNarrative(xpp));
2313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contained")) {
2314      res.getContained().add(parseResourceContained(xpp));
2315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
2316      res.getExtension().add(parseExtension(xpp));
2317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
2318      res.getModifierExtension().add(parseExtension(xpp));
2319    } else if (!parseResourceContent(eventType, xpp, res)){ 
2320        return false;
2321    }
2322    return true;
2323  }
2324
2325  protected boolean parseMetadataResourceContent(int eventType, XmlPullParser xpp, MetadataResource res) throws XmlPullParserException, IOException, FHIRFormatError {
2326    if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
2327        return false;
2328    }
2329    return true;
2330  }
2331
2332  protected boolean parseResourceContent(int eventType, XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
2333    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("id")) {
2334      res.setIdElement(parseId(xpp));
2335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meta")) {
2336      res.setMeta(parseMeta(xpp));
2337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicitRules")) {
2338      res.setImplicitRulesElement(parseUri(xpp));
2339    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
2340      res.setLanguageElement(parseCode(xpp));
2341    } else if (!parseBaseContent(eventType, xpp, res)){ 
2342        return false;
2343    }
2344    return true;
2345  }
2346
2347  protected Account parseAccount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2348    Account res = new Account();
2349    parseResourceAttributes(xpp, res);
2350    next(xpp);
2351    int eventType = nextNoWhitespace(xpp);
2352    while (eventType != XmlPullParser.END_TAG) {
2353    if (!parseAccountContent(eventType, xpp, res))
2354        unknownContent(xpp);
2355      eventType = nextNoWhitespace(xpp);
2356    }
2357    next(xpp);
2358    parseElementClose(res);
2359    return res;
2360  }
2361
2362  protected boolean parseAccountContent(int eventType, XmlPullParser xpp, Account res) throws XmlPullParserException, IOException, FHIRFormatError {
2363    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2364      res.getIdentifier().add(parseIdentifier(xpp));
2365    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2366      res.setStatusElement(parseEnumeration(xpp, Account.AccountStatus.NULL, new Account.AccountStatusEnumFactory()));
2367    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billingStatus")) {
2368      res.setBillingStatus(parseCodeableConcept(xpp));
2369    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2370      res.setType(parseCodeableConcept(xpp));
2371    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2372      res.setNameElement(parseString(xpp));
2373    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2374      res.getSubject().add(parseReference(xpp));
2375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("servicePeriod")) {
2376      res.setServicePeriod(parsePeriod(xpp));
2377    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
2378      res.getCoverage().add(parseAccountCoverageComponent(xpp));
2379    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
2380      res.setOwner(parseReference(xpp));
2381    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2382      res.setDescriptionElement(parseMarkdown(xpp));
2383    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guarantor")) {
2384      res.getGuarantor().add(parseAccountGuarantorComponent(xpp));
2385    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
2386      res.getDiagnosis().add(parseAccountDiagnosisComponent(xpp));
2387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
2388      res.getProcedure().add(parseAccountProcedureComponent(xpp));
2389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedAccount")) {
2390      res.getRelatedAccount().add(parseAccountRelatedAccountComponent(xpp));
2391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currency")) {
2392      res.setCurrency(parseCodeableConcept(xpp));
2393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("balance")) {
2394      res.getBalance().add(parseAccountBalanceComponent(xpp));
2395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("calculatedAt")) {
2396      res.setCalculatedAtElement(parseInstant(xpp));
2397    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2398      return false;
2399    }
2400    return true;
2401  }
2402
2403  protected Account.CoverageComponent parseAccountCoverageComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2404    Account.CoverageComponent res = new Account.CoverageComponent();
2405    parseElementAttributes(xpp, res);
2406    next(xpp);
2407    int eventType = nextNoWhitespace(xpp);
2408    while (eventType != XmlPullParser.END_TAG) {
2409    if (!parseAccountCoverageComponentContent(eventType, xpp, res))
2410        unknownContent(xpp);
2411      eventType = nextNoWhitespace(xpp);
2412    }
2413    next(xpp);
2414    parseElementClose(res);
2415    return res;
2416  }
2417
2418  protected boolean parseAccountCoverageComponentContent(int eventType, XmlPullParser xpp, Account.CoverageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2419    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
2420      res.setCoverage(parseReference(xpp));
2421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2422      res.setPriorityElement(parsePositiveInt(xpp));
2423    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2424      return false;
2425    }
2426    return true;
2427  }
2428
2429  protected Account.GuarantorComponent parseAccountGuarantorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2430    Account.GuarantorComponent res = new Account.GuarantorComponent();
2431    parseElementAttributes(xpp, res);
2432    next(xpp);
2433    int eventType = nextNoWhitespace(xpp);
2434    while (eventType != XmlPullParser.END_TAG) {
2435    if (!parseAccountGuarantorComponentContent(eventType, xpp, res))
2436        unknownContent(xpp);
2437      eventType = nextNoWhitespace(xpp);
2438    }
2439    next(xpp);
2440    parseElementClose(res);
2441    return res;
2442  }
2443
2444  protected boolean parseAccountGuarantorComponentContent(int eventType, XmlPullParser xpp, Account.GuarantorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2445    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
2446      res.setParty(parseReference(xpp));
2447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onHold")) {
2448      res.setOnHoldElement(parseBoolean(xpp));
2449    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
2450      res.setPeriod(parsePeriod(xpp));
2451    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2452      return false;
2453    }
2454    return true;
2455  }
2456
2457  protected Account.AccountDiagnosisComponent parseAccountDiagnosisComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2458    Account.AccountDiagnosisComponent res = new Account.AccountDiagnosisComponent();
2459    parseElementAttributes(xpp, res);
2460    next(xpp);
2461    int eventType = nextNoWhitespace(xpp);
2462    while (eventType != XmlPullParser.END_TAG) {
2463    if (!parseAccountDiagnosisComponentContent(eventType, xpp, res))
2464        unknownContent(xpp);
2465      eventType = nextNoWhitespace(xpp);
2466    }
2467    next(xpp);
2468    parseElementClose(res);
2469    return res;
2470  }
2471
2472  protected boolean parseAccountDiagnosisComponentContent(int eventType, XmlPullParser xpp, Account.AccountDiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2473    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
2474      res.setSequenceElement(parsePositiveInt(xpp));
2475    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
2476      res.setCondition(parseCodeableReference(xpp));
2477    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateOfDiagnosis")) {
2478      res.setDateOfDiagnosisElement(parseDateTime(xpp));
2479    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2480      res.getType().add(parseCodeableConcept(xpp));
2481    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onAdmission")) {
2482      res.setOnAdmissionElement(parseBoolean(xpp));
2483    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
2484      res.getPackageCode().add(parseCodeableConcept(xpp));
2485    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2486      return false;
2487    }
2488    return true;
2489  }
2490
2491  protected Account.AccountProcedureComponent parseAccountProcedureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2492    Account.AccountProcedureComponent res = new Account.AccountProcedureComponent();
2493    parseElementAttributes(xpp, res);
2494    next(xpp);
2495    int eventType = nextNoWhitespace(xpp);
2496    while (eventType != XmlPullParser.END_TAG) {
2497    if (!parseAccountProcedureComponentContent(eventType, xpp, res))
2498        unknownContent(xpp);
2499      eventType = nextNoWhitespace(xpp);
2500    }
2501    next(xpp);
2502    parseElementClose(res);
2503    return res;
2504  }
2505
2506  protected boolean parseAccountProcedureComponentContent(int eventType, XmlPullParser xpp, Account.AccountProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2507    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
2508      res.setSequenceElement(parsePositiveInt(xpp));
2509    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2510      res.setCode(parseCodeableReference(xpp));
2511    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateOfService")) {
2512      res.setDateOfServiceElement(parseDateTime(xpp));
2513    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2514      res.getType().add(parseCodeableConcept(xpp));
2515    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
2516      res.getPackageCode().add(parseCodeableConcept(xpp));
2517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
2518      res.getDevice().add(parseReference(xpp));
2519    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2520      return false;
2521    }
2522    return true;
2523  }
2524
2525  protected Account.AccountRelatedAccountComponent parseAccountRelatedAccountComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2526    Account.AccountRelatedAccountComponent res = new Account.AccountRelatedAccountComponent();
2527    parseElementAttributes(xpp, res);
2528    next(xpp);
2529    int eventType = nextNoWhitespace(xpp);
2530    while (eventType != XmlPullParser.END_TAG) {
2531    if (!parseAccountRelatedAccountComponentContent(eventType, xpp, res))
2532        unknownContent(xpp);
2533      eventType = nextNoWhitespace(xpp);
2534    }
2535    next(xpp);
2536    parseElementClose(res);
2537    return res;
2538  }
2539
2540  protected boolean parseAccountRelatedAccountComponentContent(int eventType, XmlPullParser xpp, Account.AccountRelatedAccountComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2541    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
2542      res.setRelationship(parseCodeableConcept(xpp));
2543    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
2544      res.setAccount(parseReference(xpp));
2545    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2546      return false;
2547    }
2548    return true;
2549  }
2550
2551  protected Account.AccountBalanceComponent parseAccountBalanceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2552    Account.AccountBalanceComponent res = new Account.AccountBalanceComponent();
2553    parseElementAttributes(xpp, res);
2554    next(xpp);
2555    int eventType = nextNoWhitespace(xpp);
2556    while (eventType != XmlPullParser.END_TAG) {
2557    if (!parseAccountBalanceComponentContent(eventType, xpp, res))
2558        unknownContent(xpp);
2559      eventType = nextNoWhitespace(xpp);
2560    }
2561    next(xpp);
2562    parseElementClose(res);
2563    return res;
2564  }
2565
2566  protected boolean parseAccountBalanceComponentContent(int eventType, XmlPullParser xpp, Account.AccountBalanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2567    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregate")) {
2568      res.setAggregate(parseCodeableConcept(xpp));
2569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
2570      res.setTerm(parseCodeableConcept(xpp));
2571    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("estimate")) {
2572      res.setEstimateElement(parseBoolean(xpp));
2573    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
2574      res.setAmount(parseMoney(xpp));
2575    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2576      return false;
2577    }
2578    return true;
2579  }
2580
2581  protected ActivityDefinition parseActivityDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2582    ActivityDefinition res = new ActivityDefinition();
2583    parseResourceAttributes(xpp, res);
2584    next(xpp);
2585    int eventType = nextNoWhitespace(xpp);
2586    while (eventType != XmlPullParser.END_TAG) {
2587    if (!parseActivityDefinitionContent(eventType, xpp, res))
2588        unknownContent(xpp);
2589      eventType = nextNoWhitespace(xpp);
2590    }
2591    next(xpp);
2592    parseElementClose(res);
2593    return res;
2594  }
2595
2596  protected boolean parseActivityDefinitionContent(int eventType, XmlPullParser xpp, ActivityDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2597    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2598      res.setUrlElement(parseUri(xpp));
2599    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2600      res.getIdentifier().add(parseIdentifier(xpp));
2601    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2602      res.setVersionElement(parseString(xpp));
2603    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
2604      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
2605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2606      res.setNameElement(parseString(xpp));
2607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2608      res.setTitleElement(parseString(xpp));
2609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtitle")) {
2610      res.setSubtitleElement(parseString(xpp));
2611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2612      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2614      res.setExperimentalElement(parseBoolean(xpp));
2615    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "subject")) {
2616      res.setSubject(parseType("subject", xpp));
2617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2618      res.setDateElement(parseDateTime(xpp));
2619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2620      res.setPublisherElement(parseString(xpp));
2621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2622      res.getContact().add(parseContactDetail(xpp));
2623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2624      res.setDescriptionElement(parseMarkdown(xpp));
2625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2626      res.getUseContext().add(parseUsageContext(xpp));
2627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2628      res.getJurisdiction().add(parseCodeableConcept(xpp));
2629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2630      res.setPurposeElement(parseMarkdown(xpp));
2631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
2632      res.setUsageElement(parseMarkdown(xpp));
2633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2634      res.setCopyrightElement(parseMarkdown(xpp));
2635    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
2636      res.setCopyrightLabelElement(parseString(xpp));
2637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
2638      res.setApprovalDateElement(parseDate(xpp));
2639    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
2640      res.setLastReviewDateElement(parseDate(xpp));
2641    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
2642      res.setEffectivePeriod(parsePeriod(xpp));
2643    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
2644      res.getTopic().add(parseCodeableConcept(xpp));
2645    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2646      res.getAuthor().add(parseContactDetail(xpp));
2647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
2648      res.getEditor().add(parseContactDetail(xpp));
2649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
2650      res.getReviewer().add(parseContactDetail(xpp));
2651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
2652      res.getEndorser().add(parseContactDetail(xpp));
2653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
2654      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
2655    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
2656      res.getLibrary().add(parseCanonical(xpp));
2657    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
2658      res.setKindElement(parseEnumeration(xpp, ActivityDefinition.RequestResourceTypes.NULL, new ActivityDefinition.RequestResourceTypesEnumFactory()));
2659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
2660      res.setProfileElement(parseCanonical(xpp));
2661    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2662      res.setCode(parseCodeableConcept(xpp));
2663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
2664      res.setIntentElement(parseEnumeration(xpp, Enumerations.RequestIntent.NULL, new Enumerations.RequestIntentEnumFactory()));
2665    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2666      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
2667    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
2668      res.setDoNotPerformElement(parseBoolean(xpp));
2669    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
2670      res.setTiming(parseType("timing", xpp));
2671    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
2672      res.setAsNeeded(parseType("asNeeded", xpp));
2673    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2674      res.setLocation(parseCodeableReference(xpp));
2675    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2676      res.getParticipant().add(parseActivityDefinitionParticipantComponent(xpp));
2677    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
2678      res.setProduct(parseType("product", xpp));
2679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
2680      res.setQuantity(parseQuantity(xpp));
2681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
2682      res.getDosage().add(parseDosage(xpp));
2683    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
2684      res.getBodySite().add(parseCodeableConcept(xpp));
2685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimenRequirement")) {
2686      res.getSpecimenRequirement().add(parseCanonical(xpp));
2687    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observationRequirement")) {
2688      res.getObservationRequirement().add(parseCanonical(xpp));
2689    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observationResultRequirement")) {
2690      res.getObservationResultRequirement().add(parseCanonical(xpp));
2691    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
2692      res.setTransformElement(parseCanonical(xpp));
2693    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
2694      res.getDynamicValue().add(parseActivityDefinitionDynamicValueComponent(xpp));
2695    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
2696      return false;
2697    }
2698    return true;
2699  }
2700
2701  protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2702    ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent();
2703    parseElementAttributes(xpp, res);
2704    next(xpp);
2705    int eventType = nextNoWhitespace(xpp);
2706    while (eventType != XmlPullParser.END_TAG) {
2707    if (!parseActivityDefinitionParticipantComponentContent(eventType, xpp, res))
2708        unknownContent(xpp);
2709      eventType = nextNoWhitespace(xpp);
2710    }
2711    next(xpp);
2712    parseElementClose(res);
2713    return res;
2714  }
2715
2716  protected boolean parseActivityDefinitionParticipantComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition.ActivityDefinitionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2717    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2718      res.setTypeElement(parseEnumeration(xpp, Enumerations.ActionParticipantType.NULL, new Enumerations.ActionParticipantTypeEnumFactory()));
2719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("typeCanonical")) {
2720      res.setTypeCanonicalElement(parseCanonical(xpp));
2721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("typeReference")) {
2722      res.setTypeReference(parseReference(xpp));
2723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2724      res.setRole(parseCodeableConcept(xpp));
2725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
2726      res.setFunction(parseCodeableConcept(xpp));
2727    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2728      return false;
2729    }
2730    return true;
2731  }
2732
2733  protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionDynamicValueComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2734    ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent();
2735    parseElementAttributes(xpp, res);
2736    next(xpp);
2737    int eventType = nextNoWhitespace(xpp);
2738    while (eventType != XmlPullParser.END_TAG) {
2739    if (!parseActivityDefinitionDynamicValueComponentContent(eventType, xpp, res))
2740        unknownContent(xpp);
2741      eventType = nextNoWhitespace(xpp);
2742    }
2743    next(xpp);
2744    parseElementClose(res);
2745    return res;
2746  }
2747
2748  protected boolean parseActivityDefinitionDynamicValueComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2749    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
2750      res.setPathElement(parseString(xpp));
2751    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
2752      res.setExpression(parseExpression(xpp));
2753    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2754      return false;
2755    }
2756    return true;
2757  }
2758
2759  protected ActorDefinition parseActorDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2760    ActorDefinition res = new ActorDefinition();
2761    parseResourceAttributes(xpp, res);
2762    next(xpp);
2763    int eventType = nextNoWhitespace(xpp);
2764    while (eventType != XmlPullParser.END_TAG) {
2765    if (!parseActorDefinitionContent(eventType, xpp, res))
2766        unknownContent(xpp);
2767      eventType = nextNoWhitespace(xpp);
2768    }
2769    next(xpp);
2770    parseElementClose(res);
2771    return res;
2772  }
2773
2774  protected boolean parseActorDefinitionContent(int eventType, XmlPullParser xpp, ActorDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2775    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2776      res.setUrlElement(parseUri(xpp));
2777    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2778      res.getIdentifier().add(parseIdentifier(xpp));
2779    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2780      res.setVersionElement(parseString(xpp));
2781    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
2782      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
2783    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2784      res.setNameElement(parseString(xpp));
2785    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2786      res.setTitleElement(parseString(xpp));
2787    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2788      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2789    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2790      res.setExperimentalElement(parseBoolean(xpp));
2791    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2792      res.setDateElement(parseDateTime(xpp));
2793    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2794      res.setPublisherElement(parseString(xpp));
2795    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2796      res.getContact().add(parseContactDetail(xpp));
2797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2798      res.setDescriptionElement(parseMarkdown(xpp));
2799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2800      res.getUseContext().add(parseUsageContext(xpp));
2801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2802      res.getJurisdiction().add(parseCodeableConcept(xpp));
2803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2804      res.setPurposeElement(parseMarkdown(xpp));
2805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2806      res.setCopyrightElement(parseMarkdown(xpp));
2807    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
2808      res.setCopyrightLabelElement(parseString(xpp));
2809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2810      res.setTypeElement(parseEnumeration(xpp, Enumerations.ExampleScenarioActorType.NULL, new Enumerations.ExampleScenarioActorTypeEnumFactory()));
2811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
2812      res.setDocumentationElement(parseMarkdown(xpp));
2813    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2814      res.getReference().add(parseUrl(xpp));
2815    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("capabilities")) {
2816      res.setCapabilitiesElement(parseCanonical(xpp));
2817    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivedFrom")) {
2818      res.getDerivedFrom().add(parseCanonical(xpp));
2819    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
2820      return false;
2821    }
2822    return true;
2823  }
2824
2825  protected AdministrableProductDefinition parseAdministrableProductDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2826    AdministrableProductDefinition res = new AdministrableProductDefinition();
2827    parseResourceAttributes(xpp, res);
2828    next(xpp);
2829    int eventType = nextNoWhitespace(xpp);
2830    while (eventType != XmlPullParser.END_TAG) {
2831    if (!parseAdministrableProductDefinitionContent(eventType, xpp, res))
2832        unknownContent(xpp);
2833      eventType = nextNoWhitespace(xpp);
2834    }
2835    next(xpp);
2836    parseElementClose(res);
2837    return res;
2838  }
2839
2840  protected boolean parseAdministrableProductDefinitionContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
2841    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2842      res.getIdentifier().add(parseIdentifier(xpp));
2843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2844      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("formOf")) {
2846      res.getFormOf().add(parseReference(xpp));
2847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("administrableDoseForm")) {
2848      res.setAdministrableDoseForm(parseCodeableConcept(xpp));
2849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitOfPresentation")) {
2850      res.setUnitOfPresentation(parseCodeableConcept(xpp));
2851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("producedFrom")) {
2852      res.getProducedFrom().add(parseReference(xpp));
2853    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ingredient")) {
2854      res.getIngredient().add(parseCodeableConcept(xpp));
2855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
2856      res.setDevice(parseReference(xpp));
2857    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2858      res.setDescriptionElement(parseMarkdown(xpp));
2859    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
2860      res.getProperty().add(parseAdministrableProductDefinitionPropertyComponent(xpp));
2861    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("routeOfAdministration")) {
2862      res.getRouteOfAdministration().add(parseAdministrableProductDefinitionRouteOfAdministrationComponent(xpp));
2863    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
2864      return false;
2865    }
2866    return true;
2867  }
2868
2869  protected AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent parseAdministrableProductDefinitionPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2870    AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent();
2871    parseElementAttributes(xpp, res);
2872    next(xpp);
2873    int eventType = nextNoWhitespace(xpp);
2874    while (eventType != XmlPullParser.END_TAG) {
2875    if (!parseAdministrableProductDefinitionPropertyComponentContent(eventType, xpp, res))
2876        unknownContent(xpp);
2877      eventType = nextNoWhitespace(xpp);
2878    }
2879    next(xpp);
2880    parseElementClose(res);
2881    return res;
2882  }
2883
2884  protected boolean parseAdministrableProductDefinitionPropertyComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2885    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2886      res.setType(parseCodeableConcept(xpp));
2887    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
2888      res.setValue(parseType("value", xpp));
2889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2890      res.setStatus(parseCodeableConcept(xpp));
2891    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2892      return false;
2893    }
2894    return true;
2895  }
2896
2897  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent parseAdministrableProductDefinitionRouteOfAdministrationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2898    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent();
2899    parseElementAttributes(xpp, res);
2900    next(xpp);
2901    int eventType = nextNoWhitespace(xpp);
2902    while (eventType != XmlPullParser.END_TAG) {
2903    if (!parseAdministrableProductDefinitionRouteOfAdministrationComponentContent(eventType, xpp, res))
2904        unknownContent(xpp);
2905      eventType = nextNoWhitespace(xpp);
2906    }
2907    next(xpp);
2908    parseElementClose(res);
2909    return res;
2910  }
2911
2912  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2913    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2914      res.setCode(parseCodeableConcept(xpp));
2915    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("firstDose")) {
2916      res.setFirstDose(parseQuantity(xpp));
2917    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxSingleDose")) {
2918      res.setMaxSingleDose(parseQuantity(xpp));
2919    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerDay")) {
2920      res.setMaxDosePerDay(parseQuantity(xpp));
2921    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerTreatmentPeriod")) {
2922      res.setMaxDosePerTreatmentPeriod(parseRatio(xpp));
2923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxTreatmentPeriod")) {
2924      res.setMaxTreatmentPeriod(parseDuration(xpp));
2925    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetSpecies")) {
2926      res.getTargetSpecies().add(parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(xpp));
2927    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2928      return false;
2929    }
2930    return true;
2931  }
2932
2933  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2934    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent();
2935    parseElementAttributes(xpp, res);
2936    next(xpp);
2937    int eventType = nextNoWhitespace(xpp);
2938    while (eventType != XmlPullParser.END_TAG) {
2939    if (!parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponentContent(eventType, xpp, res))
2940        unknownContent(xpp);
2941      eventType = nextNoWhitespace(xpp);
2942    }
2943    next(xpp);
2944    parseElementClose(res);
2945    return res;
2946  }
2947
2948  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2949    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2950      res.setCode(parseCodeableConcept(xpp));
2951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("withdrawalPeriod")) {
2952      res.getWithdrawalPeriod().add(parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(xpp));
2953    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2954      return false;
2955    }
2956    return true;
2957  }
2958
2959  protected AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2960    AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res = new AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent();
2961    parseElementAttributes(xpp, res);
2962    next(xpp);
2963    int eventType = nextNoWhitespace(xpp);
2964    while (eventType != XmlPullParser.END_TAG) {
2965    if (!parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentContent(eventType, xpp, res))
2966        unknownContent(xpp);
2967      eventType = nextNoWhitespace(xpp);
2968    }
2969    next(xpp);
2970    parseElementClose(res);
2971    return res;
2972  }
2973
2974  protected boolean parseAdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponentContent(int eventType, XmlPullParser xpp, AdministrableProductDefinition.AdministrableProductDefinitionRouteOfAdministrationTargetSpeciesWithdrawalPeriodComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2975    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tissue")) {
2976      res.setTissue(parseCodeableConcept(xpp));
2977    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
2978      res.setValue(parseQuantity(xpp));
2979    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2980      res.setSupportingInformationElement(parseString(xpp));
2981    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
2982      return false;
2983    }
2984    return true;
2985  }
2986
2987  protected AdverseEvent parseAdverseEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2988    AdverseEvent res = new AdverseEvent();
2989    parseResourceAttributes(xpp, res);
2990    next(xpp);
2991    int eventType = nextNoWhitespace(xpp);
2992    while (eventType != XmlPullParser.END_TAG) {
2993    if (!parseAdverseEventContent(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 parseAdverseEventContent(int eventType, XmlPullParser xpp, AdverseEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
3003    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3004      res.getIdentifier().add(parseIdentifier(xpp));
3005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3006      res.setStatusElement(parseEnumeration(xpp, AdverseEvent.AdverseEventStatus.NULL, new AdverseEvent.AdverseEventStatusEnumFactory()));
3007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actuality")) {
3008      res.setActualityElement(parseEnumeration(xpp, AdverseEvent.AdverseEventActuality.NULL, new AdverseEvent.AdverseEventActualityEnumFactory()));
3009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3010      res.getCategory().add(parseCodeableConcept(xpp));
3011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3012      res.setCode(parseCodeableConcept(xpp));
3013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3014      res.setSubject(parseReference(xpp));
3015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
3016      res.setEncounter(parseReference(xpp));
3017    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
3018      res.setOccurrence(parseType("occurrence", xpp));
3019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detected")) {
3020      res.setDetectedElement(parseDateTime(xpp));
3021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedDate")) {
3022      res.setRecordedDateElement(parseDateTime(xpp));
3023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resultingEffect")) {
3024      res.getResultingEffect().add(parseReference(xpp));
3025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3026      res.setLocation(parseReference(xpp));
3027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriousness")) {
3028      res.setSeriousness(parseCodeableConcept(xpp));
3029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
3030      res.getOutcome().add(parseCodeableConcept(xpp));
3031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
3032      res.setRecorder(parseReference(xpp));
3033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3034      res.getParticipant().add(parseAdverseEventParticipantComponent(xpp));
3035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
3036      res.getStudy().add(parseReference(xpp));
3037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expectedInResearchStudy")) {
3038      res.setExpectedInResearchStudyElement(parseBoolean(xpp));
3039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suspectEntity")) {
3040      res.getSuspectEntity().add(parseAdverseEventSuspectEntityComponent(xpp));
3041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributingFactor")) {
3042      res.getContributingFactor().add(parseAdverseEventContributingFactorComponent(xpp));
3043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preventiveAction")) {
3044      res.getPreventiveAction().add(parseAdverseEventPreventiveActionComponent(xpp));
3045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigatingAction")) {
3046      res.getMitigatingAction().add(parseAdverseEventMitigatingActionComponent(xpp));
3047    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
3048      res.getSupportingInfo().add(parseAdverseEventSupportingInfoComponent(xpp));
3049    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3050      res.getNote().add(parseAnnotation(xpp));
3051    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3052      return false;
3053    }
3054    return true;
3055  }
3056
3057  protected AdverseEvent.AdverseEventParticipantComponent parseAdverseEventParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3058    AdverseEvent.AdverseEventParticipantComponent res = new AdverseEvent.AdverseEventParticipantComponent();
3059    parseElementAttributes(xpp, res);
3060    next(xpp);
3061    int eventType = nextNoWhitespace(xpp);
3062    while (eventType != XmlPullParser.END_TAG) {
3063    if (!parseAdverseEventParticipantComponentContent(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 parseAdverseEventParticipantComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3073    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
3074      res.setFunction(parseCodeableConcept(xpp));
3075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3076      res.setActor(parseReference(xpp));
3077    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3078      return false;
3079    }
3080    return true;
3081  }
3082
3083  protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventSuspectEntityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3084    AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent();
3085    parseElementAttributes(xpp, res);
3086    next(xpp);
3087    int eventType = nextNoWhitespace(xpp);
3088    while (eventType != XmlPullParser.END_TAG) {
3089    if (!parseAdverseEventSuspectEntityComponentContent(eventType, xpp, res))
3090        unknownContent(xpp);
3091      eventType = nextNoWhitespace(xpp);
3092    }
3093    next(xpp);
3094    parseElementClose(res);
3095    return res;
3096  }
3097
3098  protected boolean parseAdverseEventSuspectEntityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSuspectEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3099    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "instance")) {
3100      res.setInstance(parseType("instance", xpp));
3101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causality")) {
3102      res.setCausality(parseAdverseEventSuspectEntityCausalityComponent(xpp));
3103    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3104      return false;
3105    }
3106    return true;
3107  }
3108
3109  protected AdverseEvent.AdverseEventSuspectEntityCausalityComponent parseAdverseEventSuspectEntityCausalityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3110    AdverseEvent.AdverseEventSuspectEntityCausalityComponent res = new AdverseEvent.AdverseEventSuspectEntityCausalityComponent();
3111    parseElementAttributes(xpp, res);
3112    next(xpp);
3113    int eventType = nextNoWhitespace(xpp);
3114    while (eventType != XmlPullParser.END_TAG) {
3115    if (!parseAdverseEventSuspectEntityCausalityComponentContent(eventType, xpp, res))
3116        unknownContent(xpp);
3117      eventType = nextNoWhitespace(xpp);
3118    }
3119    next(xpp);
3120    parseElementClose(res);
3121    return res;
3122  }
3123
3124  protected boolean parseAdverseEventSuspectEntityCausalityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSuspectEntityCausalityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3125    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessmentMethod")) {
3126      res.setAssessmentMethod(parseCodeableConcept(xpp));
3127    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entityRelatedness")) {
3128      res.setEntityRelatedness(parseCodeableConcept(xpp));
3129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3130      res.setAuthor(parseReference(xpp));
3131    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3132      return false;
3133    }
3134    return true;
3135  }
3136
3137  protected AdverseEvent.AdverseEventContributingFactorComponent parseAdverseEventContributingFactorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3138    AdverseEvent.AdverseEventContributingFactorComponent res = new AdverseEvent.AdverseEventContributingFactorComponent();
3139    parseElementAttributes(xpp, res);
3140    next(xpp);
3141    int eventType = nextNoWhitespace(xpp);
3142    while (eventType != XmlPullParser.END_TAG) {
3143    if (!parseAdverseEventContributingFactorComponentContent(eventType, xpp, res))
3144        unknownContent(xpp);
3145      eventType = nextNoWhitespace(xpp);
3146    }
3147    next(xpp);
3148    parseElementClose(res);
3149    return res;
3150  }
3151
3152  protected boolean parseAdverseEventContributingFactorComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventContributingFactorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3153    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
3154      res.setItem(parseType("item", xpp));
3155    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3156      return false;
3157    }
3158    return true;
3159  }
3160
3161  protected AdverseEvent.AdverseEventPreventiveActionComponent parseAdverseEventPreventiveActionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3162    AdverseEvent.AdverseEventPreventiveActionComponent res = new AdverseEvent.AdverseEventPreventiveActionComponent();
3163    parseElementAttributes(xpp, res);
3164    next(xpp);
3165    int eventType = nextNoWhitespace(xpp);
3166    while (eventType != XmlPullParser.END_TAG) {
3167    if (!parseAdverseEventPreventiveActionComponentContent(eventType, xpp, res))
3168        unknownContent(xpp);
3169      eventType = nextNoWhitespace(xpp);
3170    }
3171    next(xpp);
3172    parseElementClose(res);
3173    return res;
3174  }
3175
3176  protected boolean parseAdverseEventPreventiveActionComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventPreventiveActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3177    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
3178      res.setItem(parseType("item", xpp));
3179    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3180      return false;
3181    }
3182    return true;
3183  }
3184
3185  protected AdverseEvent.AdverseEventMitigatingActionComponent parseAdverseEventMitigatingActionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3186    AdverseEvent.AdverseEventMitigatingActionComponent res = new AdverseEvent.AdverseEventMitigatingActionComponent();
3187    parseElementAttributes(xpp, res);
3188    next(xpp);
3189    int eventType = nextNoWhitespace(xpp);
3190    while (eventType != XmlPullParser.END_TAG) {
3191    if (!parseAdverseEventMitigatingActionComponentContent(eventType, xpp, res))
3192        unknownContent(xpp);
3193      eventType = nextNoWhitespace(xpp);
3194    }
3195    next(xpp);
3196    parseElementClose(res);
3197    return res;
3198  }
3199
3200  protected boolean parseAdverseEventMitigatingActionComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventMitigatingActionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3201    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
3202      res.setItem(parseType("item", xpp));
3203    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3204      return false;
3205    }
3206    return true;
3207  }
3208
3209  protected AdverseEvent.AdverseEventSupportingInfoComponent parseAdverseEventSupportingInfoComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3210    AdverseEvent.AdverseEventSupportingInfoComponent res = new AdverseEvent.AdverseEventSupportingInfoComponent();
3211    parseElementAttributes(xpp, res);
3212    next(xpp);
3213    int eventType = nextNoWhitespace(xpp);
3214    while (eventType != XmlPullParser.END_TAG) {
3215    if (!parseAdverseEventSupportingInfoComponentContent(eventType, xpp, res))
3216        unknownContent(xpp);
3217      eventType = nextNoWhitespace(xpp);
3218    }
3219    next(xpp);
3220    parseElementClose(res);
3221    return res;
3222  }
3223
3224  protected boolean parseAdverseEventSupportingInfoComponentContent(int eventType, XmlPullParser xpp, AdverseEvent.AdverseEventSupportingInfoComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3225    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
3226      res.setItem(parseType("item", xpp));
3227    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3228      return false;
3229    }
3230    return true;
3231  }
3232
3233  protected AllergyIntolerance parseAllergyIntolerance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3234    AllergyIntolerance res = new AllergyIntolerance();
3235    parseResourceAttributes(xpp, res);
3236    next(xpp);
3237    int eventType = nextNoWhitespace(xpp);
3238    while (eventType != XmlPullParser.END_TAG) {
3239    if (!parseAllergyIntoleranceContent(eventType, xpp, res))
3240        unknownContent(xpp);
3241      eventType = nextNoWhitespace(xpp);
3242    }
3243    next(xpp);
3244    parseElementClose(res);
3245    return res;
3246  }
3247
3248  protected boolean parseAllergyIntoleranceContent(int eventType, XmlPullParser xpp, AllergyIntolerance res) throws XmlPullParserException, IOException, FHIRFormatError {
3249    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3250      res.getIdentifier().add(parseIdentifier(xpp));
3251    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
3252      res.setClinicalStatus(parseCodeableConcept(xpp));
3253    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
3254      res.setVerificationStatus(parseCodeableConcept(xpp));
3255    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3256      res.setType(parseCodeableConcept(xpp));
3257    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3258      res.getCategory().add(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCategory.NULL, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()));
3259    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criticality")) {
3260      res.setCriticalityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCriticality.NULL, new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()));
3261    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3262      res.setCode(parseCodeableConcept(xpp));
3263    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3264      res.setPatient(parseReference(xpp));
3265    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
3266      res.setEncounter(parseReference(xpp));
3267    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
3268      res.setOnset(parseType("onset", xpp));
3269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedDate")) {
3270      res.setRecordedDateElement(parseDateTime(xpp));
3271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3272      res.getParticipant().add(parseAllergyIntoleranceParticipantComponent(xpp));
3273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrence")) {
3274      res.setLastOccurrenceElement(parseDateTime(xpp));
3275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3276      res.getNote().add(parseAnnotation(xpp));
3277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
3278      res.getReaction().add(parseAllergyIntoleranceReactionComponent(xpp));
3279    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3280      return false;
3281    }
3282    return true;
3283  }
3284
3285  protected AllergyIntolerance.AllergyIntoleranceParticipantComponent parseAllergyIntoleranceParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3286    AllergyIntolerance.AllergyIntoleranceParticipantComponent res = new AllergyIntolerance.AllergyIntoleranceParticipantComponent();
3287    parseElementAttributes(xpp, res);
3288    next(xpp);
3289    int eventType = nextNoWhitespace(xpp);
3290    while (eventType != XmlPullParser.END_TAG) {
3291    if (!parseAllergyIntoleranceParticipantComponentContent(eventType, xpp, res))
3292        unknownContent(xpp);
3293      eventType = nextNoWhitespace(xpp);
3294    }
3295    next(xpp);
3296    parseElementClose(res);
3297    return res;
3298  }
3299
3300  protected boolean parseAllergyIntoleranceParticipantComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance.AllergyIntoleranceParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3301    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
3302      res.setFunction(parseCodeableConcept(xpp));
3303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3304      res.setActor(parseReference(xpp));
3305    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3306      return false;
3307    }
3308    return true;
3309  }
3310
3311  protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceReactionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3312    AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent();
3313    parseElementAttributes(xpp, res);
3314    next(xpp);
3315    int eventType = nextNoWhitespace(xpp);
3316    while (eventType != XmlPullParser.END_TAG) {
3317    if (!parseAllergyIntoleranceReactionComponentContent(eventType, xpp, res))
3318        unknownContent(xpp);
3319      eventType = nextNoWhitespace(xpp);
3320    }
3321    next(xpp);
3322    parseElementClose(res);
3323    return res;
3324  }
3325
3326  protected boolean parseAllergyIntoleranceReactionComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance.AllergyIntoleranceReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3327    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substance")) {
3328      res.setSubstance(parseCodeableConcept(xpp));
3329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manifestation")) {
3330      res.getManifestation().add(parseCodeableReference(xpp));
3331    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3332      res.setDescriptionElement(parseString(xpp));
3333    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onset")) {
3334      res.setOnsetElement(parseDateTime(xpp));
3335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
3336      res.setSeverityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceSeverity.NULL, new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()));
3337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exposureRoute")) {
3338      res.setExposureRoute(parseCodeableConcept(xpp));
3339    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3340      res.getNote().add(parseAnnotation(xpp));
3341    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3342      return false;
3343    }
3344    return true;
3345  }
3346
3347  protected Appointment parseAppointment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3348    Appointment res = new Appointment();
3349    parseResourceAttributes(xpp, res);
3350    next(xpp);
3351    int eventType = nextNoWhitespace(xpp);
3352    while (eventType != XmlPullParser.END_TAG) {
3353    if (!parseAppointmentContent(eventType, xpp, res))
3354        unknownContent(xpp);
3355      eventType = nextNoWhitespace(xpp);
3356    }
3357    next(xpp);
3358    parseElementClose(res);
3359    return res;
3360  }
3361
3362  protected boolean parseAppointmentContent(int eventType, XmlPullParser xpp, Appointment res) throws XmlPullParserException, IOException, FHIRFormatError {
3363    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3364      res.getIdentifier().add(parseIdentifier(xpp));
3365    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3366      res.setStatusElement(parseEnumeration(xpp, Appointment.AppointmentStatus.NULL, new Appointment.AppointmentStatusEnumFactory()));
3367    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cancellationReason")) {
3368      res.setCancellationReason(parseCodeableConcept(xpp));
3369    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
3370      res.getClass_().add(parseCodeableConcept(xpp));
3371    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
3372      res.getServiceCategory().add(parseCodeableConcept(xpp));
3373    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
3374      res.getServiceType().add(parseCodeableReference(xpp));
3375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
3376      res.getSpecialty().add(parseCodeableConcept(xpp));
3377    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
3378      res.setAppointmentType(parseCodeableConcept(xpp));
3379    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3380      res.getReason().add(parseCodeableReference(xpp));
3381    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
3382      res.setPriority(parseCodeableConcept(xpp));
3383    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3384      res.setDescriptionElement(parseString(xpp));
3385    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
3386      res.getReplaces().add(parseReference(xpp));
3387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("virtualService")) {
3388      res.getVirtualService().add(parseVirtualServiceDetail(xpp));
3389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
3390      res.getSupportingInformation().add(parseReference(xpp));
3391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previousAppointment")) {
3392      res.setPreviousAppointment(parseReference(xpp));
3393    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originatingAppointment")) {
3394      res.setOriginatingAppointment(parseReference(xpp));
3395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
3396      res.setStartElement(parseInstant(xpp));
3397    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
3398      res.setEndElement(parseInstant(xpp));
3399    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minutesDuration")) {
3400      res.setMinutesDurationElement(parsePositiveInt(xpp));
3401    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestedPeriod")) {
3402      res.getRequestedPeriod().add(parsePeriod(xpp));
3403    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slot")) {
3404      res.getSlot().add(parseReference(xpp));
3405    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
3406      res.getAccount().add(parseReference(xpp));
3407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3408      res.setCreatedElement(parseDateTime(xpp));
3409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cancellationDate")) {
3410      res.setCancellationDateElement(parseDateTime(xpp));
3411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3412      res.getNote().add(parseAnnotation(xpp));
3413    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
3414      res.getPatientInstruction().add(parseCodeableReference(xpp));
3415    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3416      res.getBasedOn().add(parseReference(xpp));
3417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3418      res.setSubject(parseReference(xpp));
3419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3420      res.getParticipant().add(parseAppointmentParticipantComponent(xpp));
3421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recurrenceId")) {
3422      res.setRecurrenceIdElement(parsePositiveInt(xpp));
3423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("occurrenceChanged")) {
3424      res.setOccurrenceChangedElement(parseBoolean(xpp));
3425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recurrenceTemplate")) {
3426      res.getRecurrenceTemplate().add(parseAppointmentRecurrenceTemplateComponent(xpp));
3427    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3428      return false;
3429    }
3430    return true;
3431  }
3432
3433  protected Appointment.AppointmentParticipantComponent parseAppointmentParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3434    Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent();
3435    parseElementAttributes(xpp, res);
3436    next(xpp);
3437    int eventType = nextNoWhitespace(xpp);
3438    while (eventType != XmlPullParser.END_TAG) {
3439    if (!parseAppointmentParticipantComponentContent(eventType, xpp, res))
3440        unknownContent(xpp);
3441      eventType = nextNoWhitespace(xpp);
3442    }
3443    next(xpp);
3444    parseElementClose(res);
3445    return res;
3446  }
3447
3448  protected boolean parseAppointmentParticipantComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3449    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3450      res.getType().add(parseCodeableConcept(xpp));
3451    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3452      res.setPeriod(parsePeriod(xpp));
3453    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3454      res.setActor(parseReference(xpp));
3455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
3456      res.setRequiredElement(parseBoolean(xpp));
3457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3458      res.setStatusElement(parseEnumeration(xpp, Appointment.ParticipationStatus.NULL, new Appointment.ParticipationStatusEnumFactory()));
3459    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3460      return false;
3461    }
3462    return true;
3463  }
3464
3465  protected Appointment.AppointmentRecurrenceTemplateComponent parseAppointmentRecurrenceTemplateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3466    Appointment.AppointmentRecurrenceTemplateComponent res = new Appointment.AppointmentRecurrenceTemplateComponent();
3467    parseElementAttributes(xpp, res);
3468    next(xpp);
3469    int eventType = nextNoWhitespace(xpp);
3470    while (eventType != XmlPullParser.END_TAG) {
3471    if (!parseAppointmentRecurrenceTemplateComponentContent(eventType, xpp, res))
3472        unknownContent(xpp);
3473      eventType = nextNoWhitespace(xpp);
3474    }
3475    next(xpp);
3476    parseElementClose(res);
3477    return res;
3478  }
3479
3480  protected boolean parseAppointmentRecurrenceTemplateComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentRecurrenceTemplateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3481    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timezone")) {
3482      res.setTimezone(parseCodeableConcept(xpp));
3483    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recurrenceType")) {
3484      res.setRecurrenceType(parseCodeableConcept(xpp));
3485    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrenceDate")) {
3486      res.setLastOccurrenceDateElement(parseDate(xpp));
3487    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("occurrenceCount")) {
3488      res.setOccurrenceCountElement(parsePositiveInt(xpp));
3489    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("occurrenceDate")) {
3490      res.getOccurrenceDate().add(parseDate(xpp));
3491    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("weeklyTemplate")) {
3492      res.setWeeklyTemplate(parseAppointmentRecurrenceTemplateWeeklyTemplateComponent(xpp));
3493    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("monthlyTemplate")) {
3494      res.setMonthlyTemplate(parseAppointmentRecurrenceTemplateMonthlyTemplateComponent(xpp));
3495    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("yearlyTemplate")) {
3496      res.setYearlyTemplate(parseAppointmentRecurrenceTemplateYearlyTemplateComponent(xpp));
3497    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludingDate")) {
3498      res.getExcludingDate().add(parseDate(xpp));
3499    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludingRecurrenceId")) {
3500      res.getExcludingRecurrenceId().add(parsePositiveInt(xpp));
3501    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3502      return false;
3503    }
3504    return true;
3505  }
3506
3507  protected Appointment.AppointmentRecurrenceTemplateWeeklyTemplateComponent parseAppointmentRecurrenceTemplateWeeklyTemplateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3508    Appointment.AppointmentRecurrenceTemplateWeeklyTemplateComponent res = new Appointment.AppointmentRecurrenceTemplateWeeklyTemplateComponent();
3509    parseElementAttributes(xpp, res);
3510    next(xpp);
3511    int eventType = nextNoWhitespace(xpp);
3512    while (eventType != XmlPullParser.END_TAG) {
3513    if (!parseAppointmentRecurrenceTemplateWeeklyTemplateComponentContent(eventType, xpp, res))
3514        unknownContent(xpp);
3515      eventType = nextNoWhitespace(xpp);
3516    }
3517    next(xpp);
3518    parseElementClose(res);
3519    return res;
3520  }
3521
3522  protected boolean parseAppointmentRecurrenceTemplateWeeklyTemplateComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentRecurrenceTemplateWeeklyTemplateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3523    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("monday")) {
3524      res.setMondayElement(parseBoolean(xpp));
3525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tuesday")) {
3526      res.setTuesdayElement(parseBoolean(xpp));
3527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("wednesday")) {
3528      res.setWednesdayElement(parseBoolean(xpp));
3529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("thursday")) {
3530      res.setThursdayElement(parseBoolean(xpp));
3531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("friday")) {
3532      res.setFridayElement(parseBoolean(xpp));
3533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("saturday")) {
3534      res.setSaturdayElement(parseBoolean(xpp));
3535    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sunday")) {
3536      res.setSundayElement(parseBoolean(xpp));
3537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("weekInterval")) {
3538      res.setWeekIntervalElement(parsePositiveInt(xpp));
3539    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3540      return false;
3541    }
3542    return true;
3543  }
3544
3545  protected Appointment.AppointmentRecurrenceTemplateMonthlyTemplateComponent parseAppointmentRecurrenceTemplateMonthlyTemplateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3546    Appointment.AppointmentRecurrenceTemplateMonthlyTemplateComponent res = new Appointment.AppointmentRecurrenceTemplateMonthlyTemplateComponent();
3547    parseElementAttributes(xpp, res);
3548    next(xpp);
3549    int eventType = nextNoWhitespace(xpp);
3550    while (eventType != XmlPullParser.END_TAG) {
3551    if (!parseAppointmentRecurrenceTemplateMonthlyTemplateComponentContent(eventType, xpp, res))
3552        unknownContent(xpp);
3553      eventType = nextNoWhitespace(xpp);
3554    }
3555    next(xpp);
3556    parseElementClose(res);
3557    return res;
3558  }
3559
3560  protected boolean parseAppointmentRecurrenceTemplateMonthlyTemplateComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentRecurrenceTemplateMonthlyTemplateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3561    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfMonth")) {
3562      res.setDayOfMonthElement(parsePositiveInt(xpp));
3563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("nthWeekOfMonth")) {
3564      res.setNthWeekOfMonth(parseCoding(xpp));
3565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
3566      res.setDayOfWeek(parseCoding(xpp));
3567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("monthInterval")) {
3568      res.setMonthIntervalElement(parsePositiveInt(xpp));
3569    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3570      return false;
3571    }
3572    return true;
3573  }
3574
3575  protected Appointment.AppointmentRecurrenceTemplateYearlyTemplateComponent parseAppointmentRecurrenceTemplateYearlyTemplateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3576    Appointment.AppointmentRecurrenceTemplateYearlyTemplateComponent res = new Appointment.AppointmentRecurrenceTemplateYearlyTemplateComponent();
3577    parseElementAttributes(xpp, res);
3578    next(xpp);
3579    int eventType = nextNoWhitespace(xpp);
3580    while (eventType != XmlPullParser.END_TAG) {
3581    if (!parseAppointmentRecurrenceTemplateYearlyTemplateComponentContent(eventType, xpp, res))
3582        unknownContent(xpp);
3583      eventType = nextNoWhitespace(xpp);
3584    }
3585    next(xpp);
3586    parseElementClose(res);
3587    return res;
3588  }
3589
3590  protected boolean parseAppointmentRecurrenceTemplateYearlyTemplateComponentContent(int eventType, XmlPullParser xpp, Appointment.AppointmentRecurrenceTemplateYearlyTemplateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3591    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("yearInterval")) {
3592      res.setYearIntervalElement(parsePositiveInt(xpp));
3593    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3594      return false;
3595    }
3596    return true;
3597  }
3598
3599  protected AppointmentResponse parseAppointmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3600    AppointmentResponse res = new AppointmentResponse();
3601    parseResourceAttributes(xpp, res);
3602    next(xpp);
3603    int eventType = nextNoWhitespace(xpp);
3604    while (eventType != XmlPullParser.END_TAG) {
3605    if (!parseAppointmentResponseContent(eventType, xpp, res))
3606        unknownContent(xpp);
3607      eventType = nextNoWhitespace(xpp);
3608    }
3609    next(xpp);
3610    parseElementClose(res);
3611    return res;
3612  }
3613
3614  protected boolean parseAppointmentResponseContent(int eventType, XmlPullParser xpp, AppointmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
3615    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3616      res.getIdentifier().add(parseIdentifier(xpp));
3617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
3618      res.setAppointment(parseReference(xpp));
3619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("proposedNewTime")) {
3620      res.setProposedNewTimeElement(parseBoolean(xpp));
3621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
3622      res.setStartElement(parseInstant(xpp));
3623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
3624      res.setEndElement(parseInstant(xpp));
3625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantType")) {
3626      res.getParticipantType().add(parseCodeableConcept(xpp));
3627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3628      res.setActor(parseReference(xpp));
3629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantStatus")) {
3630      res.setParticipantStatusElement(parseEnumeration(xpp, AppointmentResponse.AppointmentResponseStatus.NULL, new AppointmentResponse.AppointmentResponseStatusEnumFactory()));
3631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
3632      res.setCommentElement(parseMarkdown(xpp));
3633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recurring")) {
3634      res.setRecurringElement(parseBoolean(xpp));
3635    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("occurrenceDate")) {
3636      res.setOccurrenceDateElement(parseDate(xpp));
3637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recurrenceId")) {
3638      res.setRecurrenceIdElement(parsePositiveInt(xpp));
3639    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3640      return false;
3641    }
3642    return true;
3643  }
3644
3645  protected ArtifactAssessment parseArtifactAssessment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3646    ArtifactAssessment res = new ArtifactAssessment();
3647    parseResourceAttributes(xpp, res);
3648    next(xpp);
3649    int eventType = nextNoWhitespace(xpp);
3650    while (eventType != XmlPullParser.END_TAG) {
3651    if (!parseArtifactAssessmentContent(eventType, xpp, res))
3652        unknownContent(xpp);
3653      eventType = nextNoWhitespace(xpp);
3654    }
3655    next(xpp);
3656    parseElementClose(res);
3657    return res;
3658  }
3659
3660  protected boolean parseArtifactAssessmentContent(int eventType, XmlPullParser xpp, ArtifactAssessment res) throws XmlPullParserException, IOException, FHIRFormatError {
3661    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3662      res.getIdentifier().add(parseIdentifier(xpp));
3663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
3664      res.setTitleElement(parseString(xpp));
3665    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "citeAs")) {
3666      res.setCiteAs(parseType("citeAs", xpp));
3667    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3668      res.setDateElement(parseDateTime(xpp));
3669    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
3670      res.setCopyrightElement(parseMarkdown(xpp));
3671    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
3672      res.setApprovalDateElement(parseDate(xpp));
3673    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
3674      res.setLastReviewDateElement(parseDate(xpp));
3675    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "artifact")) {
3676      res.setArtifact(parseType("artifact", xpp));
3677    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
3678      res.getContent().add(parseArtifactAssessmentContentComponent(xpp));
3679    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("workflowStatus")) {
3680      res.setWorkflowStatusElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentWorkflowStatus.NULL, new ArtifactAssessment.ArtifactAssessmentWorkflowStatusEnumFactory()));
3681    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
3682      res.setDispositionElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentDisposition.NULL, new ArtifactAssessment.ArtifactAssessmentDispositionEnumFactory()));
3683    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3684      return false;
3685    }
3686    return true;
3687  }
3688
3689  protected ArtifactAssessment.ArtifactAssessmentContentComponent parseArtifactAssessmentContentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3690    ArtifactAssessment.ArtifactAssessmentContentComponent res = new ArtifactAssessment.ArtifactAssessmentContentComponent();
3691    parseElementAttributes(xpp, res);
3692    next(xpp);
3693    int eventType = nextNoWhitespace(xpp);
3694    while (eventType != XmlPullParser.END_TAG) {
3695    if (!parseArtifactAssessmentContentComponentContent(eventType, xpp, res))
3696        unknownContent(xpp);
3697      eventType = nextNoWhitespace(xpp);
3698    }
3699    next(xpp);
3700    parseElementClose(res);
3701    return res;
3702  }
3703
3704  protected boolean parseArtifactAssessmentContentComponentContent(int eventType, XmlPullParser xpp, ArtifactAssessment.ArtifactAssessmentContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3705    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationType")) {
3706      res.setInformationTypeElement(parseEnumeration(xpp, ArtifactAssessment.ArtifactAssessmentInformationType.NULL, new ArtifactAssessment.ArtifactAssessmentInformationTypeEnumFactory()));
3707    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
3708      res.setSummaryElement(parseMarkdown(xpp));
3709    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3710      res.setType(parseCodeableConcept(xpp));
3711    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
3712      res.getClassifier().add(parseCodeableConcept(xpp));
3713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3714      res.setQuantity(parseQuantity(xpp));
3715    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3716      res.setAuthor(parseReference(xpp));
3717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
3718      res.getPath().add(parseUri(xpp));
3719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
3720      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
3721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("freeToShare")) {
3722      res.setFreeToShareElement(parseBoolean(xpp));
3723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("component")) {
3724      res.getComponent().add(parseArtifactAssessmentContentComponent(xpp));
3725    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3726      return false;
3727    }
3728    return true;
3729  }
3730
3731  protected AuditEvent parseAuditEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3732    AuditEvent res = new AuditEvent();
3733    parseResourceAttributes(xpp, res);
3734    next(xpp);
3735    int eventType = nextNoWhitespace(xpp);
3736    while (eventType != XmlPullParser.END_TAG) {
3737    if (!parseAuditEventContent(eventType, xpp, res))
3738        unknownContent(xpp);
3739      eventType = nextNoWhitespace(xpp);
3740    }
3741    next(xpp);
3742    parseElementClose(res);
3743    return res;
3744  }
3745
3746  protected boolean parseAuditEventContent(int eventType, XmlPullParser xpp, AuditEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
3747    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3748      res.getCategory().add(parseCodeableConcept(xpp));
3749    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3750      res.setCode(parseCodeableConcept(xpp));
3751    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
3752      res.setActionElement(parseEnumeration(xpp, AuditEvent.AuditEventAction.NULL, new AuditEvent.AuditEventActionEnumFactory()));
3753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
3754      res.setSeverityElement(parseEnumeration(xpp, AuditEvent.AuditEventSeverity.NULL, new AuditEvent.AuditEventSeverityEnumFactory()));
3755    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurred")) {
3756      res.setOccurred(parseType("occurred", xpp));
3757    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
3758      res.setRecordedElement(parseInstant(xpp));
3759    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
3760      res.setOutcome(parseAuditEventOutcomeComponent(xpp));
3761    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authorization")) {
3762      res.getAuthorization().add(parseCodeableConcept(xpp));
3763    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3764      res.getBasedOn().add(parseReference(xpp));
3765    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3766      res.setPatient(parseReference(xpp));
3767    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
3768      res.setEncounter(parseReference(xpp));
3769    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
3770      res.getAgent().add(parseAuditEventAgentComponent(xpp));
3771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
3772      res.setSource(parseAuditEventSourceComponent(xpp));
3773    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
3774      res.getEntity().add(parseAuditEventEntityComponent(xpp));
3775    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3776      return false;
3777    }
3778    return true;
3779  }
3780
3781  protected AuditEvent.AuditEventOutcomeComponent parseAuditEventOutcomeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3782    AuditEvent.AuditEventOutcomeComponent res = new AuditEvent.AuditEventOutcomeComponent();
3783    parseElementAttributes(xpp, res);
3784    next(xpp);
3785    int eventType = nextNoWhitespace(xpp);
3786    while (eventType != XmlPullParser.END_TAG) {
3787    if (!parseAuditEventOutcomeComponentContent(eventType, xpp, res))
3788        unknownContent(xpp);
3789      eventType = nextNoWhitespace(xpp);
3790    }
3791    next(xpp);
3792    parseElementClose(res);
3793    return res;
3794  }
3795
3796  protected boolean parseAuditEventOutcomeComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventOutcomeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3797    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3798      res.setCode(parseCoding(xpp));
3799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3800      res.getDetail().add(parseCodeableConcept(xpp));
3801    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3802      return false;
3803    }
3804    return true;
3805  }
3806
3807  protected AuditEvent.AuditEventAgentComponent parseAuditEventAgentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3808    AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent();
3809    parseElementAttributes(xpp, res);
3810    next(xpp);
3811    int eventType = nextNoWhitespace(xpp);
3812    while (eventType != XmlPullParser.END_TAG) {
3813    if (!parseAuditEventAgentComponentContent(eventType, xpp, res))
3814        unknownContent(xpp);
3815      eventType = nextNoWhitespace(xpp);
3816    }
3817    next(xpp);
3818    parseElementClose(res);
3819    return res;
3820  }
3821
3822  protected boolean parseAuditEventAgentComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3823    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3824      res.setType(parseCodeableConcept(xpp));
3825    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3826      res.getRole().add(parseCodeableConcept(xpp));
3827    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("who")) {
3828      res.setWho(parseReference(xpp));
3829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
3830      res.setRequestorElement(parseBoolean(xpp));
3831    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3832      res.setLocation(parseReference(xpp));
3833    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
3834      res.getPolicy().add(parseUri(xpp));
3835    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "network")) {
3836      res.setNetwork(parseType("network", xpp));
3837    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authorization")) {
3838      res.getAuthorization().add(parseCodeableConcept(xpp));
3839    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3840      return false;
3841    }
3842    return true;
3843  }
3844
3845  protected AuditEvent.AuditEventSourceComponent parseAuditEventSourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3846    AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent();
3847    parseElementAttributes(xpp, res);
3848    next(xpp);
3849    int eventType = nextNoWhitespace(xpp);
3850    while (eventType != XmlPullParser.END_TAG) {
3851    if (!parseAuditEventSourceComponentContent(eventType, xpp, res))
3852        unknownContent(xpp);
3853      eventType = nextNoWhitespace(xpp);
3854    }
3855    next(xpp);
3856    parseElementClose(res);
3857    return res;
3858  }
3859
3860  protected boolean parseAuditEventSourceComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3861    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
3862      res.setSite(parseReference(xpp));
3863    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("observer")) {
3864      res.setObserver(parseReference(xpp));
3865    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3866      res.getType().add(parseCodeableConcept(xpp));
3867    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3868      return false;
3869    }
3870    return true;
3871  }
3872
3873  protected AuditEvent.AuditEventEntityComponent parseAuditEventEntityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3874    AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent();
3875    parseElementAttributes(xpp, res);
3876    next(xpp);
3877    int eventType = nextNoWhitespace(xpp);
3878    while (eventType != XmlPullParser.END_TAG) {
3879    if (!parseAuditEventEntityComponentContent(eventType, xpp, res))
3880        unknownContent(xpp);
3881      eventType = nextNoWhitespace(xpp);
3882    }
3883    next(xpp);
3884    parseElementClose(res);
3885    return res;
3886  }
3887
3888  protected boolean parseAuditEventEntityComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3889    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("what")) {
3890      res.setWhat(parseReference(xpp));
3891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3892      res.setRole(parseCodeableConcept(xpp));
3893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
3894      res.getSecurityLabel().add(parseCodeableConcept(xpp));
3895    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("query")) {
3896      res.setQueryElement(parseBase64Binary(xpp));
3897    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3898      res.getDetail().add(parseAuditEventEntityDetailComponent(xpp));
3899    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
3900      res.getAgent().add(parseAuditEventAgentComponent(xpp));
3901    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3902      return false;
3903    }
3904    return true;
3905  }
3906
3907  protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventEntityDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3908    AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent();
3909    parseElementAttributes(xpp, res);
3910    next(xpp);
3911    int eventType = nextNoWhitespace(xpp);
3912    while (eventType != XmlPullParser.END_TAG) {
3913    if (!parseAuditEventEntityDetailComponentContent(eventType, xpp, res))
3914        unknownContent(xpp);
3915      eventType = nextNoWhitespace(xpp);
3916    }
3917    next(xpp);
3918    parseElementClose(res);
3919    return res;
3920  }
3921
3922  protected boolean parseAuditEventEntityDetailComponentContent(int eventType, XmlPullParser xpp, AuditEvent.AuditEventEntityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3923    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3924      res.setType(parseCodeableConcept(xpp));
3925    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3926      res.setValue(parseType("value", xpp));
3927    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
3928      return false;
3929    }
3930    return true;
3931  }
3932
3933  protected Basic parseBasic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3934    Basic res = new Basic();
3935    parseResourceAttributes(xpp, res);
3936    next(xpp);
3937    int eventType = nextNoWhitespace(xpp);
3938    while (eventType != XmlPullParser.END_TAG) {
3939    if (!parseBasicContent(eventType, xpp, res))
3940        unknownContent(xpp);
3941      eventType = nextNoWhitespace(xpp);
3942    }
3943    next(xpp);
3944    parseElementClose(res);
3945    return res;
3946  }
3947
3948  protected boolean parseBasicContent(int eventType, XmlPullParser xpp, Basic res) throws XmlPullParserException, IOException, FHIRFormatError {
3949    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3950      res.getIdentifier().add(parseIdentifier(xpp));
3951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3952      res.setCode(parseCodeableConcept(xpp));
3953    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3954      res.setSubject(parseReference(xpp));
3955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3956      res.setCreatedElement(parseDateTime(xpp));
3957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3958      res.setAuthor(parseReference(xpp));
3959    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
3960      return false;
3961    }
3962    return true;
3963  }
3964
3965  protected Binary parseBinary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3966    Binary res = new Binary();
3967    parseResourceAttributes(xpp, res);
3968    next(xpp);
3969    int eventType = nextNoWhitespace(xpp);
3970    while (eventType != XmlPullParser.END_TAG) {
3971    if (!parseBinaryContent(eventType, xpp, res))
3972        unknownContent(xpp);
3973      eventType = nextNoWhitespace(xpp);
3974    }
3975    next(xpp);
3976    parseElementClose(res);
3977    return res;
3978  }
3979
3980  protected boolean parseBinaryContent(int eventType, XmlPullParser xpp, Binary res) throws XmlPullParserException, IOException, FHIRFormatError {
3981    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
3982      res.setContentTypeElement(parseCode(xpp));
3983    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityContext")) {
3984      res.setSecurityContext(parseReference(xpp));
3985    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
3986      res.setDataElement(parseBase64Binary(xpp));
3987    } else if (!parseResourceContent(eventType, xpp, res)){ 
3988      return false;
3989    }
3990    return true;
3991  }
3992
3993  protected BiologicallyDerivedProduct parseBiologicallyDerivedProduct(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3994    BiologicallyDerivedProduct res = new BiologicallyDerivedProduct();
3995    parseResourceAttributes(xpp, res);
3996    next(xpp);
3997    int eventType = nextNoWhitespace(xpp);
3998    while (eventType != XmlPullParser.END_TAG) {
3999    if (!parseBiologicallyDerivedProductContent(eventType, xpp, res))
4000        unknownContent(xpp);
4001      eventType = nextNoWhitespace(xpp);
4002    }
4003    next(xpp);
4004    parseElementClose(res);
4005    return res;
4006  }
4007
4008  protected boolean parseBiologicallyDerivedProductContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct res) throws XmlPullParserException, IOException, FHIRFormatError {
4009    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productCategory")) {
4010      res.setProductCategory(parseCoding(xpp));
4011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productCode")) {
4012      res.setProductCode(parseCodeableConcept(xpp));
4013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
4014      res.getParent().add(parseReference(xpp));
4015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
4016      res.getRequest().add(parseReference(xpp));
4017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4018      res.getIdentifier().add(parseIdentifier(xpp));
4019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("biologicalSourceEvent")) {
4020      res.setBiologicalSourceEvent(parseIdentifier(xpp));
4021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processingFacility")) {
4022      res.getProcessingFacility().add(parseReference(xpp));
4023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("division")) {
4024      res.setDivisionElement(parseString(xpp));
4025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productStatus")) {
4026      res.setProductStatus(parseCoding(xpp));
4027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
4028      res.setExpirationDateElement(parseDateTime(xpp));
4029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collection")) {
4030      res.setCollection(parseBiologicallyDerivedProductCollectionComponent(xpp));
4031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("storageTempRequirements")) {
4032      res.setStorageTempRequirements(parseRange(xpp));
4033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4034      res.getProperty().add(parseBiologicallyDerivedProductPropertyComponent(xpp));
4035    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4036      return false;
4037    }
4038    return true;
4039  }
4040
4041  protected BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent parseBiologicallyDerivedProductCollectionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4042    BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent();
4043    parseElementAttributes(xpp, res);
4044    next(xpp);
4045    int eventType = nextNoWhitespace(xpp);
4046    while (eventType != XmlPullParser.END_TAG) {
4047    if (!parseBiologicallyDerivedProductCollectionComponentContent(eventType, xpp, res))
4048        unknownContent(xpp);
4049      eventType = nextNoWhitespace(xpp);
4050    }
4051    next(xpp);
4052    parseElementClose(res);
4053    return res;
4054  }
4055
4056  protected boolean parseBiologicallyDerivedProductCollectionComponentContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductCollectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4057    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("collector")) {
4058      res.setCollector(parseReference(xpp));
4059    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
4060      res.setSource(parseReference(xpp));
4061    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "collected")) {
4062      res.setCollected(parseType("collected", xpp));
4063    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4064      return false;
4065    }
4066    return true;
4067  }
4068
4069  protected BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent parseBiologicallyDerivedProductPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4070    BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent res = new BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent();
4071    parseElementAttributes(xpp, res);
4072    next(xpp);
4073    int eventType = nextNoWhitespace(xpp);
4074    while (eventType != XmlPullParser.END_TAG) {
4075    if (!parseBiologicallyDerivedProductPropertyComponentContent(eventType, xpp, res))
4076        unknownContent(xpp);
4077      eventType = nextNoWhitespace(xpp);
4078    }
4079    next(xpp);
4080    parseElementClose(res);
4081    return res;
4082  }
4083
4084  protected boolean parseBiologicallyDerivedProductPropertyComponentContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProduct.BiologicallyDerivedProductPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4085    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4086      res.setType(parseCodeableConcept(xpp));
4087    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
4088      res.setValue(parseType("value", xpp));
4089    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4090      return false;
4091    }
4092    return true;
4093  }
4094
4095  protected BiologicallyDerivedProductDispense parseBiologicallyDerivedProductDispense(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4096    BiologicallyDerivedProductDispense res = new BiologicallyDerivedProductDispense();
4097    parseResourceAttributes(xpp, res);
4098    next(xpp);
4099    int eventType = nextNoWhitespace(xpp);
4100    while (eventType != XmlPullParser.END_TAG) {
4101    if (!parseBiologicallyDerivedProductDispenseContent(eventType, xpp, res))
4102        unknownContent(xpp);
4103      eventType = nextNoWhitespace(xpp);
4104    }
4105    next(xpp);
4106    parseElementClose(res);
4107    return res;
4108  }
4109
4110  protected boolean parseBiologicallyDerivedProductDispenseContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProductDispense res) throws XmlPullParserException, IOException, FHIRFormatError {
4111    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4112      res.getIdentifier().add(parseIdentifier(xpp));
4113    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4114      res.getBasedOn().add(parseReference(xpp));
4115    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4116      res.getPartOf().add(parseReference(xpp));
4117    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4118      res.setStatusElement(parseEnumeration(xpp, BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispenseCodes.NULL, new BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispenseCodesEnumFactory()));
4119    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originRelationshipType")) {
4120      res.setOriginRelationshipType(parseCodeableConcept(xpp));
4121    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
4122      res.setProduct(parseReference(xpp));
4123    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
4124      res.setPatient(parseReference(xpp));
4125    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("matchStatus")) {
4126      res.setMatchStatus(parseCodeableConcept(xpp));
4127    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
4128      res.getPerformer().add(parseBiologicallyDerivedProductDispensePerformerComponent(xpp));
4129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
4130      res.setLocation(parseReference(xpp));
4131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4132      res.setQuantity(parseQuantity(xpp));
4133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preparedDate")) {
4134      res.setPreparedDateElement(parseDateTime(xpp));
4135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenHandedOver")) {
4136      res.setWhenHandedOverElement(parseDateTime(xpp));
4137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
4138      res.setDestination(parseReference(xpp));
4139    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4140      res.getNote().add(parseAnnotation(xpp));
4141    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usageInstruction")) {
4142      res.setUsageInstructionElement(parseString(xpp));
4143    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4144      return false;
4145    }
4146    return true;
4147  }
4148
4149  protected BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispensePerformerComponent parseBiologicallyDerivedProductDispensePerformerComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4150    BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispensePerformerComponent res = new BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispensePerformerComponent();
4151    parseElementAttributes(xpp, res);
4152    next(xpp);
4153    int eventType = nextNoWhitespace(xpp);
4154    while (eventType != XmlPullParser.END_TAG) {
4155    if (!parseBiologicallyDerivedProductDispensePerformerComponentContent(eventType, xpp, res))
4156        unknownContent(xpp);
4157      eventType = nextNoWhitespace(xpp);
4158    }
4159    next(xpp);
4160    parseElementClose(res);
4161    return res;
4162  }
4163
4164  protected boolean parseBiologicallyDerivedProductDispensePerformerComponentContent(int eventType, XmlPullParser xpp, BiologicallyDerivedProductDispense.BiologicallyDerivedProductDispensePerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4165    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
4166      res.setFunction(parseCodeableConcept(xpp));
4167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
4168      res.setActor(parseReference(xpp));
4169    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4170      return false;
4171    }
4172    return true;
4173  }
4174
4175  protected BodyStructure parseBodyStructure(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4176    BodyStructure res = new BodyStructure();
4177    parseResourceAttributes(xpp, res);
4178    next(xpp);
4179    int eventType = nextNoWhitespace(xpp);
4180    while (eventType != XmlPullParser.END_TAG) {
4181    if (!parseBodyStructureContent(eventType, xpp, res))
4182        unknownContent(xpp);
4183      eventType = nextNoWhitespace(xpp);
4184    }
4185    next(xpp);
4186    parseElementClose(res);
4187    return res;
4188  }
4189
4190  protected boolean parseBodyStructureContent(int eventType, XmlPullParser xpp, BodyStructure res) throws XmlPullParserException, IOException, FHIRFormatError {
4191    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4192      res.getIdentifier().add(parseIdentifier(xpp));
4193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
4194      res.setActiveElement(parseBoolean(xpp));
4195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("morphology")) {
4196      res.setMorphology(parseCodeableConcept(xpp));
4197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includedStructure")) {
4198      res.getIncludedStructure().add(parseBodyStructureIncludedStructureComponent(xpp));
4199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludedStructure")) {
4200      res.getExcludedStructure().add(parseBodyStructureIncludedStructureComponent(xpp));
4201    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4202      res.setDescriptionElement(parseMarkdown(xpp));
4203    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
4204      res.getImage().add(parseAttachment(xpp));
4205    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
4206      res.setPatient(parseReference(xpp));
4207    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
4208      return false;
4209    }
4210    return true;
4211  }
4212
4213  protected BodyStructure.BodyStructureIncludedStructureComponent parseBodyStructureIncludedStructureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4214    BodyStructure.BodyStructureIncludedStructureComponent res = new BodyStructure.BodyStructureIncludedStructureComponent();
4215    parseElementAttributes(xpp, res);
4216    next(xpp);
4217    int eventType = nextNoWhitespace(xpp);
4218    while (eventType != XmlPullParser.END_TAG) {
4219    if (!parseBodyStructureIncludedStructureComponentContent(eventType, xpp, res))
4220        unknownContent(xpp);
4221      eventType = nextNoWhitespace(xpp);
4222    }
4223    next(xpp);
4224    parseElementClose(res);
4225    return res;
4226  }
4227
4228  protected boolean parseBodyStructureIncludedStructureComponentContent(int eventType, XmlPullParser xpp, BodyStructure.BodyStructureIncludedStructureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4229    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("structure")) {
4230      res.setStructure(parseCodeableConcept(xpp));
4231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("laterality")) {
4232      res.setLaterality(parseCodeableConcept(xpp));
4233    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodyLandmarkOrientation")) {
4234      res.getBodyLandmarkOrientation().add(parseBodyStructureIncludedStructureBodyLandmarkOrientationComponent(xpp));
4235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("spatialReference")) {
4236      res.getSpatialReference().add(parseReference(xpp));
4237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
4238      res.getQualifier().add(parseCodeableConcept(xpp));
4239    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4240      return false;
4241    }
4242    return true;
4243  }
4244
4245  protected BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationComponent parseBodyStructureIncludedStructureBodyLandmarkOrientationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4246    BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationComponent res = new BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationComponent();
4247    parseElementAttributes(xpp, res);
4248    next(xpp);
4249    int eventType = nextNoWhitespace(xpp);
4250    while (eventType != XmlPullParser.END_TAG) {
4251    if (!parseBodyStructureIncludedStructureBodyLandmarkOrientationComponentContent(eventType, xpp, res))
4252        unknownContent(xpp);
4253      eventType = nextNoWhitespace(xpp);
4254    }
4255    next(xpp);
4256    parseElementClose(res);
4257    return res;
4258  }
4259
4260  protected boolean parseBodyStructureIncludedStructureBodyLandmarkOrientationComponentContent(int eventType, XmlPullParser xpp, BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4261    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("landmarkDescription")) {
4262      res.getLandmarkDescription().add(parseCodeableConcept(xpp));
4263    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clockFacePosition")) {
4264      res.getClockFacePosition().add(parseCodeableConcept(xpp));
4265    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("distanceFromLandmark")) {
4266      res.getDistanceFromLandmark().add(parseBodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent(xpp));
4267    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("surfaceOrientation")) {
4268      res.getSurfaceOrientation().add(parseCodeableConcept(xpp));
4269    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4270      return false;
4271    }
4272    return true;
4273  }
4274
4275  protected BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent parseBodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4276    BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent res = new BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent();
4277    parseElementAttributes(xpp, res);
4278    next(xpp);
4279    int eventType = nextNoWhitespace(xpp);
4280    while (eventType != XmlPullParser.END_TAG) {
4281    if (!parseBodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponentContent(eventType, xpp, res))
4282        unknownContent(xpp);
4283      eventType = nextNoWhitespace(xpp);
4284    }
4285    next(xpp);
4286    parseElementClose(res);
4287    return res;
4288  }
4289
4290  protected boolean parseBodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponentContent(int eventType, XmlPullParser xpp, BodyStructure.BodyStructureIncludedStructureBodyLandmarkOrientationDistanceFromLandmarkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4291    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
4292      res.getDevice().add(parseCodeableReference(xpp));
4293    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4294      res.getValue().add(parseQuantity(xpp));
4295    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4296      return false;
4297    }
4298    return true;
4299  }
4300
4301  protected Bundle parseBundle(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4302    Bundle res = new Bundle();
4303    parseResourceAttributes(xpp, res);
4304    next(xpp);
4305    int eventType = nextNoWhitespace(xpp);
4306    while (eventType != XmlPullParser.END_TAG) {
4307    if (!parseBundleContent(eventType, xpp, res))
4308        unknownContent(xpp);
4309      eventType = nextNoWhitespace(xpp);
4310    }
4311    next(xpp);
4312    parseElementClose(res);
4313    return res;
4314  }
4315
4316  protected boolean parseBundleContent(int eventType, XmlPullParser xpp, Bundle res) throws XmlPullParserException, IOException, FHIRFormatError {
4317    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4318      res.setIdentifier(parseIdentifier(xpp));
4319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4320      res.setTypeElement(parseEnumeration(xpp, Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory()));
4321    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timestamp")) {
4322      res.setTimestampElement(parseInstant(xpp));
4323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
4324      res.setTotalElement(parseUnsignedInt(xpp));
4325    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
4326      res.getLink().add(parseBundleLinkComponent(xpp));
4327    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
4328      res.getEntry().add(parseBundleEntryComponent(xpp));
4329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
4330      res.setSignature(parseSignature(xpp));
4331    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issues")) {
4332      res.setIssues(parseResourceContained(xpp));
4333    } else if (!parseResourceContent(eventType, xpp, res)){ 
4334      return false;
4335    }
4336    return true;
4337  }
4338
4339  protected Bundle.BundleLinkComponent parseBundleLinkComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4340    Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent();
4341    parseElementAttributes(xpp, res);
4342    next(xpp);
4343    int eventType = nextNoWhitespace(xpp);
4344    while (eventType != XmlPullParser.END_TAG) {
4345    if (!parseBundleLinkComponentContent(eventType, xpp, res))
4346        unknownContent(xpp);
4347      eventType = nextNoWhitespace(xpp);
4348    }
4349    next(xpp);
4350    parseElementClose(res);
4351    return res;
4352  }
4353
4354  protected boolean parseBundleLinkComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4355    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relation")) {
4356      res.setRelationElement(parseEnumeration(xpp, Bundle.LinkRelationTypes.NULL, new Bundle.LinkRelationTypesEnumFactory()));
4357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4358      res.setUrlElement(parseUri(xpp));
4359    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4360      return false;
4361    }
4362    return true;
4363  }
4364
4365  protected Bundle.BundleEntryComponent parseBundleEntryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4366    Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent();
4367    parseElementAttributes(xpp, res);
4368    next(xpp);
4369    int eventType = nextNoWhitespace(xpp);
4370    while (eventType != XmlPullParser.END_TAG) {
4371    if (!parseBundleEntryComponentContent(eventType, xpp, res))
4372        unknownContent(xpp);
4373      eventType = nextNoWhitespace(xpp);
4374    }
4375    next(xpp);
4376    parseElementClose(res);
4377    return res;
4378  }
4379
4380  protected boolean parseBundleEntryComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4381    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
4382      res.getLink().add(parseBundleLinkComponent(xpp));
4383    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fullUrl")) {
4384      res.setFullUrlElement(parseUri(xpp));
4385    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
4386      res.setResource(parseResourceContained(xpp));
4387    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
4388      res.setSearch(parseBundleEntrySearchComponent(xpp));
4389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
4390      res.setRequest(parseBundleEntryRequestComponent(xpp));
4391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
4392      res.setResponse(parseBundleEntryResponseComponent(xpp));
4393    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4394      return false;
4395    }
4396    return true;
4397  }
4398
4399  protected Bundle.BundleEntrySearchComponent parseBundleEntrySearchComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4400    Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent();
4401    parseElementAttributes(xpp, res);
4402    next(xpp);
4403    int eventType = nextNoWhitespace(xpp);
4404    while (eventType != XmlPullParser.END_TAG) {
4405    if (!parseBundleEntrySearchComponentContent(eventType, xpp, res))
4406        unknownContent(xpp);
4407      eventType = nextNoWhitespace(xpp);
4408    }
4409    next(xpp);
4410    parseElementClose(res);
4411    return res;
4412  }
4413
4414  protected boolean parseBundleEntrySearchComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntrySearchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4415    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4416      res.setModeElement(parseEnumeration(xpp, Bundle.SearchEntryMode.NULL, new Bundle.SearchEntryModeEnumFactory()));
4417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
4418      res.setScoreElement(parseDecimal(xpp));
4419    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4420      return false;
4421    }
4422    return true;
4423  }
4424
4425  protected Bundle.BundleEntryRequestComponent parseBundleEntryRequestComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4426    Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent();
4427    parseElementAttributes(xpp, res);
4428    next(xpp);
4429    int eventType = nextNoWhitespace(xpp);
4430    while (eventType != XmlPullParser.END_TAG) {
4431    if (!parseBundleEntryRequestComponentContent(eventType, xpp, res))
4432        unknownContent(xpp);
4433      eventType = nextNoWhitespace(xpp);
4434    }
4435    next(xpp);
4436    parseElementClose(res);
4437    return res;
4438  }
4439
4440  protected boolean parseBundleEntryRequestComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4441    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
4442      res.setMethodElement(parseEnumeration(xpp, Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory()));
4443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4444      res.setUrlElement(parseUri(xpp));
4445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneMatch")) {
4446      res.setIfNoneMatchElement(parseString(xpp));
4447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifModifiedSince")) {
4448      res.setIfModifiedSinceElement(parseInstant(xpp));
4449    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifMatch")) {
4450      res.setIfMatchElement(parseString(xpp));
4451    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneExist")) {
4452      res.setIfNoneExistElement(parseString(xpp));
4453    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4454      return false;
4455    }
4456    return true;
4457  }
4458
4459  protected Bundle.BundleEntryResponseComponent parseBundleEntryResponseComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4460    Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent();
4461    parseElementAttributes(xpp, res);
4462    next(xpp);
4463    int eventType = nextNoWhitespace(xpp);
4464    while (eventType != XmlPullParser.END_TAG) {
4465    if (!parseBundleEntryResponseComponentContent(eventType, xpp, res))
4466        unknownContent(xpp);
4467      eventType = nextNoWhitespace(xpp);
4468    }
4469    next(xpp);
4470    parseElementClose(res);
4471    return res;
4472  }
4473
4474  protected boolean parseBundleEntryResponseComponentContent(int eventType, XmlPullParser xpp, Bundle.BundleEntryResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4475    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4476      res.setStatusElement(parseString(xpp));
4477    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
4478      res.setLocationElement(parseUri(xpp));
4479    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("etag")) {
4480      res.setEtagElement(parseString(xpp));
4481    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
4482      res.setLastModifiedElement(parseInstant(xpp));
4483    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
4484      res.setOutcome(parseResourceContained(xpp));
4485    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4486      return false;
4487    }
4488    return true;
4489  }
4490
4491  protected CapabilityStatement parseCapabilityStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4492    CapabilityStatement res = new CapabilityStatement();
4493    parseResourceAttributes(xpp, res);
4494    next(xpp);
4495    int eventType = nextNoWhitespace(xpp);
4496    while (eventType != XmlPullParser.END_TAG) {
4497    if (!parseCapabilityStatementContent(eventType, xpp, res))
4498        unknownContent(xpp);
4499      eventType = nextNoWhitespace(xpp);
4500    }
4501    next(xpp);
4502    parseElementClose(res);
4503    return res;
4504  }
4505
4506  protected boolean parseCapabilityStatementContent(int eventType, XmlPullParser xpp, CapabilityStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
4507    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4508      res.setUrlElement(parseUri(xpp));
4509    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4510      res.getIdentifier().add(parseIdentifier(xpp));
4511    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4512      res.setVersionElement(parseString(xpp));
4513    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
4514      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
4515    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4516      res.setNameElement(parseString(xpp));
4517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4518      res.setTitleElement(parseString(xpp));
4519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4520      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4522      res.setExperimentalElement(parseBoolean(xpp));
4523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4524      res.setDateElement(parseDateTime(xpp));
4525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4526      res.setPublisherElement(parseString(xpp));
4527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4528      res.getContact().add(parseContactDetail(xpp));
4529    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4530      res.setDescriptionElement(parseMarkdown(xpp));
4531    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4532      res.getUseContext().add(parseUsageContext(xpp));
4533    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4534      res.getJurisdiction().add(parseCodeableConcept(xpp));
4535    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
4536      res.setPurposeElement(parseMarkdown(xpp));
4537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4538      res.setCopyrightElement(parseMarkdown(xpp));
4539    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
4540      res.setCopyrightLabelElement(parseString(xpp));
4541    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
4542      res.setKindElement(parseEnumeration(xpp, Enumerations.CapabilityStatementKind.NULL, new Enumerations.CapabilityStatementKindEnumFactory()));
4543    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
4544      res.getInstantiates().add(parseCanonical(xpp));
4545    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imports")) {
4546      res.getImports().add(parseCanonical(xpp));
4547    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
4548      res.setSoftware(parseCapabilityStatementSoftwareComponent(xpp));
4549    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
4550      res.setImplementation(parseCapabilityStatementImplementationComponent(xpp));
4551    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
4552      res.setFhirVersionElement(parseEnumeration(xpp, Enumerations.FHIRVersion.NULL, new Enumerations.FHIRVersionEnumFactory()));
4553    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
4554      res.getFormat().add(parseCode(xpp));
4555    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
4556      res.getPatchFormat().add(parseCode(xpp));
4557    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("acceptLanguage")) {
4558      res.getAcceptLanguage().add(parseCode(xpp));
4559    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
4560      res.getImplementationGuide().add(parseCanonical(xpp));
4561    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
4562      res.getRest().add(parseCapabilityStatementRestComponent(xpp));
4563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("messaging")) {
4564      res.getMessaging().add(parseCapabilityStatementMessagingComponent(xpp));
4565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
4566      res.getDocument().add(parseCapabilityStatementDocumentComponent(xpp));
4567    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
4568      return false;
4569    }
4570    return true;
4571  }
4572
4573  protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementSoftwareComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4574    CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent();
4575    parseElementAttributes(xpp, res);
4576    next(xpp);
4577    int eventType = nextNoWhitespace(xpp);
4578    while (eventType != XmlPullParser.END_TAG) {
4579    if (!parseCapabilityStatementSoftwareComponentContent(eventType, xpp, res))
4580        unknownContent(xpp);
4581      eventType = nextNoWhitespace(xpp);
4582    }
4583    next(xpp);
4584    parseElementClose(res);
4585    return res;
4586  }
4587
4588  protected boolean parseCapabilityStatementSoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementSoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4589    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4590      res.setNameElement(parseString(xpp));
4591    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4592      res.setVersionElement(parseString(xpp));
4593    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
4594      res.setReleaseDateElement(parseDateTime(xpp));
4595    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4596      return false;
4597    }
4598    return true;
4599  }
4600
4601  protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementImplementationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4602    CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent();
4603    parseElementAttributes(xpp, res);
4604    next(xpp);
4605    int eventType = nextNoWhitespace(xpp);
4606    while (eventType != XmlPullParser.END_TAG) {
4607    if (!parseCapabilityStatementImplementationComponentContent(eventType, xpp, res))
4608        unknownContent(xpp);
4609      eventType = nextNoWhitespace(xpp);
4610    }
4611    next(xpp);
4612    parseElementClose(res);
4613    return res;
4614  }
4615
4616  protected boolean parseCapabilityStatementImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4617    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4618      res.setDescriptionElement(parseMarkdown(xpp));
4619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4620      res.setUrlElement(parseUrl(xpp));
4621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
4622      res.setCustodian(parseReference(xpp));
4623    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4624      return false;
4625    }
4626    return true;
4627  }
4628
4629  protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementRestComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4630    CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent();
4631    parseElementAttributes(xpp, res);
4632    next(xpp);
4633    int eventType = nextNoWhitespace(xpp);
4634    while (eventType != XmlPullParser.END_TAG) {
4635    if (!parseCapabilityStatementRestComponentContent(eventType, xpp, res))
4636        unknownContent(xpp);
4637      eventType = nextNoWhitespace(xpp);
4638    }
4639    next(xpp);
4640    parseElementClose(res);
4641    return res;
4642  }
4643
4644  protected boolean parseCapabilityStatementRestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4645    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4646      res.setModeElement(parseEnumeration(xpp, CapabilityStatement.RestfulCapabilityMode.NULL, new CapabilityStatement.RestfulCapabilityModeEnumFactory()));
4647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4648      res.setDocumentationElement(parseMarkdown(xpp));
4649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
4650      res.setSecurity(parseCapabilityStatementRestSecurityComponent(xpp));
4651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
4652      res.getResource().add(parseCapabilityStatementRestResourceComponent(xpp));
4653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
4654      res.getInteraction().add(parseCapabilityStatementSystemInteractionComponent(xpp));
4655    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
4656      res.getSearchParam().add(parseCapabilityStatementRestResourceSearchParamComponent(xpp));
4657    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
4658      res.getOperation().add(parseCapabilityStatementRestResourceOperationComponent(xpp));
4659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
4660      res.getCompartment().add(parseCanonical(xpp));
4661    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4662      return false;
4663    }
4664    return true;
4665  }
4666
4667  protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementRestSecurityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4668    CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent();
4669    parseElementAttributes(xpp, res);
4670    next(xpp);
4671    int eventType = nextNoWhitespace(xpp);
4672    while (eventType != XmlPullParser.END_TAG) {
4673    if (!parseCapabilityStatementRestSecurityComponentContent(eventType, xpp, res))
4674        unknownContent(xpp);
4675      eventType = nextNoWhitespace(xpp);
4676    }
4677    next(xpp);
4678    parseElementClose(res);
4679    return res;
4680  }
4681
4682  protected boolean parseCapabilityStatementRestSecurityComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestSecurityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4683    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cors")) {
4684      res.setCorsElement(parseBoolean(xpp));
4685    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4686      res.getService().add(parseCodeableConcept(xpp));
4687    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4688      res.setDescriptionElement(parseMarkdown(xpp));
4689    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4690      return false;
4691    }
4692    return true;
4693  }
4694
4695  protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementRestResourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4696    CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent();
4697    parseElementAttributes(xpp, res);
4698    next(xpp);
4699    int eventType = nextNoWhitespace(xpp);
4700    while (eventType != XmlPullParser.END_TAG) {
4701    if (!parseCapabilityStatementRestResourceComponentContent(eventType, xpp, res))
4702        unknownContent(xpp);
4703      eventType = nextNoWhitespace(xpp);
4704    }
4705    next(xpp);
4706    parseElementClose(res);
4707    return res;
4708  }
4709
4710  protected boolean parseCapabilityStatementRestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4711    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4712      res.setTypeElement(parseCode(xpp));
4713    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
4714      res.setProfileElement(parseCanonical(xpp));
4715    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedProfile")) {
4716      res.getSupportedProfile().add(parseCanonical(xpp));
4717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4718      res.setDocumentationElement(parseMarkdown(xpp));
4719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
4720      res.getInteraction().add(parseCapabilityStatementResourceInteractionComponent(xpp));
4721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
4722      res.setVersioningElement(parseEnumeration(xpp, CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory()));
4723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readHistory")) {
4724      res.setReadHistoryElement(parseBoolean(xpp));
4725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("updateCreate")) {
4726      res.setUpdateCreateElement(parseBoolean(xpp));
4727    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalCreate")) {
4728      res.setConditionalCreateElement(parseBoolean(xpp));
4729    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalRead")) {
4730      res.setConditionalReadElement(parseEnumeration(xpp, CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory()));
4731    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalUpdate")) {
4732      res.setConditionalUpdateElement(parseBoolean(xpp));
4733    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalPatch")) {
4734      res.setConditionalPatchElement(parseBoolean(xpp));
4735    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalDelete")) {
4736      res.setConditionalDeleteElement(parseEnumeration(xpp, CapabilityStatement.ConditionalDeleteStatus.NULL, new CapabilityStatement.ConditionalDeleteStatusEnumFactory()));
4737    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referencePolicy")) {
4738      res.getReferencePolicy().add(parseEnumeration(xpp, CapabilityStatement.ReferenceHandlingPolicy.NULL, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()));
4739    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchInclude")) {
4740      res.getSearchInclude().add(parseString(xpp));
4741    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchRevInclude")) {
4742      res.getSearchRevInclude().add(parseString(xpp));
4743    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
4744      res.getSearchParam().add(parseCapabilityStatementRestResourceSearchParamComponent(xpp));
4745    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
4746      res.getOperation().add(parseCapabilityStatementRestResourceOperationComponent(xpp));
4747    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4748      return false;
4749    }
4750    return true;
4751  }
4752
4753  protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4754    CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent();
4755    parseElementAttributes(xpp, res);
4756    next(xpp);
4757    int eventType = nextNoWhitespace(xpp);
4758    while (eventType != XmlPullParser.END_TAG) {
4759    if (!parseCapabilityStatementResourceInteractionComponentContent(eventType, xpp, res))
4760        unknownContent(xpp);
4761      eventType = nextNoWhitespace(xpp);
4762    }
4763    next(xpp);
4764    parseElementClose(res);
4765    return res;
4766  }
4767
4768  protected boolean parseCapabilityStatementResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4769    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4770      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.TypeRestfulInteraction.NULL, new CapabilityStatement.TypeRestfulInteractionEnumFactory()));
4771    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4772      res.setDocumentationElement(parseMarkdown(xpp));
4773    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4774      return false;
4775    }
4776    return true;
4777  }
4778
4779  protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementRestResourceSearchParamComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4780    CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
4781    parseElementAttributes(xpp, res);
4782    next(xpp);
4783    int eventType = nextNoWhitespace(xpp);
4784    while (eventType != XmlPullParser.END_TAG) {
4785    if (!parseCapabilityStatementRestResourceSearchParamComponentContent(eventType, xpp, res))
4786        unknownContent(xpp);
4787      eventType = nextNoWhitespace(xpp);
4788    }
4789    next(xpp);
4790    parseElementClose(res);
4791    return res;
4792  }
4793
4794  protected boolean parseCapabilityStatementRestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4795    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4796      res.setNameElement(parseString(xpp));
4797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4798      res.setDefinitionElement(parseCanonical(xpp));
4799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4800      res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
4801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4802      res.setDocumentationElement(parseMarkdown(xpp));
4803    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4804      return false;
4805    }
4806    return true;
4807  }
4808
4809  protected CapabilityStatement.CapabilityStatementRestResourceOperationComponent parseCapabilityStatementRestResourceOperationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4810    CapabilityStatement.CapabilityStatementRestResourceOperationComponent res = new CapabilityStatement.CapabilityStatementRestResourceOperationComponent();
4811    parseElementAttributes(xpp, res);
4812    next(xpp);
4813    int eventType = nextNoWhitespace(xpp);
4814    while (eventType != XmlPullParser.END_TAG) {
4815    if (!parseCapabilityStatementRestResourceOperationComponentContent(eventType, xpp, res))
4816        unknownContent(xpp);
4817      eventType = nextNoWhitespace(xpp);
4818    }
4819    next(xpp);
4820    parseElementClose(res);
4821    return res;
4822  }
4823
4824  protected boolean parseCapabilityStatementRestResourceOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementRestResourceOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4825    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4826      res.setNameElement(parseString(xpp));
4827    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4828      res.setDefinitionElement(parseCanonical(xpp));
4829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4830      res.setDocumentationElement(parseMarkdown(xpp));
4831    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4832      return false;
4833    }
4834    return true;
4835  }
4836
4837  protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4838    CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent();
4839    parseElementAttributes(xpp, res);
4840    next(xpp);
4841    int eventType = nextNoWhitespace(xpp);
4842    while (eventType != XmlPullParser.END_TAG) {
4843    if (!parseCapabilityStatementSystemInteractionComponentContent(eventType, xpp, res))
4844        unknownContent(xpp);
4845      eventType = nextNoWhitespace(xpp);
4846    }
4847    next(xpp);
4848    parseElementClose(res);
4849    return res;
4850  }
4851
4852  protected boolean parseCapabilityStatementSystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4853    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4854      res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.SystemRestfulInteraction.NULL, new CapabilityStatement.SystemRestfulInteractionEnumFactory()));
4855    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4856      res.setDocumentationElement(parseMarkdown(xpp));
4857    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4858      return false;
4859    }
4860    return true;
4861  }
4862
4863  protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementMessagingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4864    CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent();
4865    parseElementAttributes(xpp, res);
4866    next(xpp);
4867    int eventType = nextNoWhitespace(xpp);
4868    while (eventType != XmlPullParser.END_TAG) {
4869    if (!parseCapabilityStatementMessagingComponentContent(eventType, xpp, res))
4870        unknownContent(xpp);
4871      eventType = nextNoWhitespace(xpp);
4872    }
4873    next(xpp);
4874    parseElementClose(res);
4875    return res;
4876  }
4877
4878  protected boolean parseCapabilityStatementMessagingComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4879    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
4880      res.getEndpoint().add(parseCapabilityStatementMessagingEndpointComponent(xpp));
4881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reliableCache")) {
4882      res.setReliableCacheElement(parseUnsignedInt(xpp));
4883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4884      res.setDocumentationElement(parseMarkdown(xpp));
4885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedMessage")) {
4886      res.getSupportedMessage().add(parseCapabilityStatementMessagingSupportedMessageComponent(xpp));
4887    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4888      return false;
4889    }
4890    return true;
4891  }
4892
4893  protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementMessagingEndpointComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4894    CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
4895    parseElementAttributes(xpp, res);
4896    next(xpp);
4897    int eventType = nextNoWhitespace(xpp);
4898    while (eventType != XmlPullParser.END_TAG) {
4899    if (!parseCapabilityStatementMessagingEndpointComponentContent(eventType, xpp, res))
4900        unknownContent(xpp);
4901      eventType = nextNoWhitespace(xpp);
4902    }
4903    next(xpp);
4904    parseElementClose(res);
4905    return res;
4906  }
4907
4908  protected boolean parseCapabilityStatementMessagingEndpointComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4909    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
4910      res.setProtocol(parseCoding(xpp));
4911    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
4912      res.setAddressElement(parseUrl(xpp));
4913    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4914      return false;
4915    }
4916    return true;
4917  }
4918
4919  protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementMessagingSupportedMessageComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4920    CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
4921    parseElementAttributes(xpp, res);
4922    next(xpp);
4923    int eventType = nextNoWhitespace(xpp);
4924    while (eventType != XmlPullParser.END_TAG) {
4925    if (!parseCapabilityStatementMessagingSupportedMessageComponentContent(eventType, xpp, res))
4926        unknownContent(xpp);
4927      eventType = nextNoWhitespace(xpp);
4928    }
4929    next(xpp);
4930    parseElementClose(res);
4931    return res;
4932  }
4933
4934  protected boolean parseCapabilityStatementMessagingSupportedMessageComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4935    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4936      res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
4937    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4938      res.setDefinitionElement(parseCanonical(xpp));
4939    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4940      return false;
4941    }
4942    return true;
4943  }
4944
4945  protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementDocumentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4946    CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent();
4947    parseElementAttributes(xpp, res);
4948    next(xpp);
4949    int eventType = nextNoWhitespace(xpp);
4950    while (eventType != XmlPullParser.END_TAG) {
4951    if (!parseCapabilityStatementDocumentComponentContent(eventType, xpp, res))
4952        unknownContent(xpp);
4953      eventType = nextNoWhitespace(xpp);
4954    }
4955    next(xpp);
4956    parseElementClose(res);
4957    return res;
4958  }
4959
4960  protected boolean parseCapabilityStatementDocumentComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement.CapabilityStatementDocumentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4961    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
4962      res.setModeElement(parseEnumeration(xpp, CapabilityStatement.DocumentMode.NULL, new CapabilityStatement.DocumentModeEnumFactory()));
4963    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
4964      res.setDocumentationElement(parseMarkdown(xpp));
4965    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
4966      res.setProfileElement(parseCanonical(xpp));
4967    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
4968      return false;
4969    }
4970    return true;
4971  }
4972
4973  protected CarePlan parseCarePlan(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4974    CarePlan res = new CarePlan();
4975    parseResourceAttributes(xpp, res);
4976    next(xpp);
4977    int eventType = nextNoWhitespace(xpp);
4978    while (eventType != XmlPullParser.END_TAG) {
4979    if (!parseCarePlanContent(eventType, xpp, res))
4980        unknownContent(xpp);
4981      eventType = nextNoWhitespace(xpp);
4982    }
4983    next(xpp);
4984    parseElementClose(res);
4985    return res;
4986  }
4987
4988  protected boolean parseCarePlanContent(int eventType, XmlPullParser xpp, CarePlan res) throws XmlPullParserException, IOException, FHIRFormatError {
4989    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4990      res.getIdentifier().add(parseIdentifier(xpp));
4991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesCanonical")) {
4992      res.getInstantiatesCanonical().add(parseCanonical(xpp));
4993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesUri")) {
4994      res.getInstantiatesUri().add(parseUri(xpp));
4995    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4996      res.getBasedOn().add(parseReference(xpp));
4997    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4998      res.getReplaces().add(parseReference(xpp));
4999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
5000      res.getPartOf().add(parseReference(xpp));
5001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5002      res.setStatusElement(parseEnumeration(xpp, Enumerations.RequestStatus.NULL, new Enumerations.RequestStatusEnumFactory()));
5003    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
5004      res.setIntentElement(parseEnumeration(xpp, CarePlan.CarePlanIntent.NULL, new CarePlan.CarePlanIntentEnumFactory()));
5005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5006      res.getCategory().add(parseCodeableConcept(xpp));
5007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5008      res.setTitleElement(parseString(xpp));
5009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5010      res.setDescriptionElement(parseString(xpp));
5011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5012      res.setSubject(parseReference(xpp));
5013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
5014      res.setEncounter(parseReference(xpp));
5015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5016      res.setPeriod(parsePeriod(xpp));
5017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
5018      res.setCreatedElement(parseDateTime(xpp));
5019    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
5020      res.setCustodian(parseReference(xpp));
5021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
5022      res.getContributor().add(parseReference(xpp));
5023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
5024      res.getCareTeam().add(parseReference(xpp));
5025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
5026      res.getAddresses().add(parseCodeableReference(xpp));
5027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
5028      res.getSupportingInfo().add(parseReference(xpp));
5029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
5030      res.getGoal().add(parseReference(xpp));
5031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
5032      res.getActivity().add(parseCarePlanActivityComponent(xpp));
5033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5034      res.getNote().add(parseAnnotation(xpp));
5035    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
5036      return false;
5037    }
5038    return true;
5039  }
5040
5041  protected CarePlan.CarePlanActivityComponent parseCarePlanActivityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5042    CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent();
5043    parseElementAttributes(xpp, res);
5044    next(xpp);
5045    int eventType = nextNoWhitespace(xpp);
5046    while (eventType != XmlPullParser.END_TAG) {
5047    if (!parseCarePlanActivityComponentContent(eventType, xpp, res))
5048        unknownContent(xpp);
5049      eventType = nextNoWhitespace(xpp);
5050    }
5051    next(xpp);
5052    parseElementClose(res);
5053    return res;
5054  }
5055
5056  protected boolean parseCarePlanActivityComponentContent(int eventType, XmlPullParser xpp, CarePlan.CarePlanActivityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5057    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performedActivity")) {
5058      res.getPerformedActivity().add(parseCodeableReference(xpp));
5059    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("progress")) {
5060      res.getProgress().add(parseAnnotation(xpp));
5061    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plannedActivityReference")) {
5062      res.setPlannedActivityReference(parseReference(xpp));
5063    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5064      return false;
5065    }
5066    return true;
5067  }
5068
5069  protected CareTeam parseCareTeam(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5070    CareTeam res = new CareTeam();
5071    parseResourceAttributes(xpp, res);
5072    next(xpp);
5073    int eventType = nextNoWhitespace(xpp);
5074    while (eventType != XmlPullParser.END_TAG) {
5075    if (!parseCareTeamContent(eventType, xpp, res))
5076        unknownContent(xpp);
5077      eventType = nextNoWhitespace(xpp);
5078    }
5079    next(xpp);
5080    parseElementClose(res);
5081    return res;
5082  }
5083
5084  protected boolean parseCareTeamContent(int eventType, XmlPullParser xpp, CareTeam res) throws XmlPullParserException, IOException, FHIRFormatError {
5085    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5086      res.getIdentifier().add(parseIdentifier(xpp));
5087    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5088      res.setStatusElement(parseEnumeration(xpp, CareTeam.CareTeamStatus.NULL, new CareTeam.CareTeamStatusEnumFactory()));
5089    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5090      res.getCategory().add(parseCodeableConcept(xpp));
5091    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5092      res.setNameElement(parseString(xpp));
5093    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5094      res.setSubject(parseReference(xpp));
5095    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5096      res.setPeriod(parsePeriod(xpp));
5097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
5098      res.getParticipant().add(parseCareTeamParticipantComponent(xpp));
5099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
5100      res.getReason().add(parseCodeableReference(xpp));
5101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
5102      res.getManagingOrganization().add(parseReference(xpp));
5103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
5104      res.getTelecom().add(parseContactPoint(xpp));
5105    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5106      res.getNote().add(parseAnnotation(xpp));
5107    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
5108      return false;
5109    }
5110    return true;
5111  }
5112
5113  protected CareTeam.CareTeamParticipantComponent parseCareTeamParticipantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5114    CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent();
5115    parseElementAttributes(xpp, res);
5116    next(xpp);
5117    int eventType = nextNoWhitespace(xpp);
5118    while (eventType != XmlPullParser.END_TAG) {
5119    if (!parseCareTeamParticipantComponentContent(eventType, xpp, res))
5120        unknownContent(xpp);
5121      eventType = nextNoWhitespace(xpp);
5122    }
5123    next(xpp);
5124    parseElementClose(res);
5125    return res;
5126  }
5127
5128  protected boolean parseCareTeamParticipantComponentContent(int eventType, XmlPullParser xpp, CareTeam.CareTeamParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5129    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5130      res.setRole(parseCodeableConcept(xpp));
5131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
5132      res.setMember(parseReference(xpp));
5133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
5134      res.setOnBehalfOf(parseReference(xpp));
5135    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "coverage")) {
5136      res.setCoverage(parseType("coverage", xpp));
5137    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5138      return false;
5139    }
5140    return true;
5141  }
5142
5143  protected ChargeItem parseChargeItem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5144    ChargeItem res = new ChargeItem();
5145    parseResourceAttributes(xpp, res);
5146    next(xpp);
5147    int eventType = nextNoWhitespace(xpp);
5148    while (eventType != XmlPullParser.END_TAG) {
5149    if (!parseChargeItemContent(eventType, xpp, res))
5150        unknownContent(xpp);
5151      eventType = nextNoWhitespace(xpp);
5152    }
5153    next(xpp);
5154    parseElementClose(res);
5155    return res;
5156  }
5157
5158  protected boolean parseChargeItemContent(int eventType, XmlPullParser xpp, ChargeItem res) throws XmlPullParserException, IOException, FHIRFormatError {
5159    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5160      res.getIdentifier().add(parseIdentifier(xpp));
5161    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definitionUri")) {
5162      res.getDefinitionUri().add(parseUri(xpp));
5163    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definitionCanonical")) {
5164      res.getDefinitionCanonical().add(parseCanonical(xpp));
5165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5166      res.setStatusElement(parseEnumeration(xpp, ChargeItem.ChargeItemStatus.NULL, new ChargeItem.ChargeItemStatusEnumFactory()));
5167    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
5168      res.getPartOf().add(parseReference(xpp));
5169    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5170      res.setCode(parseCodeableConcept(xpp));
5171    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5172      res.setSubject(parseReference(xpp));
5173    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
5174      res.setEncounter(parseReference(xpp));
5175    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
5176      res.setOccurrence(parseType("occurrence", xpp));
5177    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
5178      res.getPerformer().add(parseChargeItemPerformerComponent(xpp));
5179    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performingOrganization")) {
5180      res.setPerformingOrganization(parseReference(xpp));
5181    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestingOrganization")) {
5182      res.setRequestingOrganization(parseReference(xpp));
5183    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("costCenter")) {
5184      res.setCostCenter(parseReference(xpp));
5185    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
5186      res.setQuantity(parseQuantity(xpp));
5187    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodysite")) {
5188      res.getBodysite().add(parseCodeableConcept(xpp));
5189    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPriceComponent")) {
5190      res.setUnitPriceComponent(parseMonetaryComponent(xpp));
5191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalPriceComponent")) {
5192      res.setTotalPriceComponent(parseMonetaryComponent(xpp));
5193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overrideReason")) {
5194      res.setOverrideReason(parseCodeableConcept(xpp));
5195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
5196      res.setEnterer(parseReference(xpp));
5197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteredDate")) {
5198      res.setEnteredDateElement(parseDateTime(xpp));
5199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
5200      res.getReason().add(parseCodeableConcept(xpp));
5201    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
5202      res.getService().add(parseCodeableReference(xpp));
5203    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
5204      res.getProduct().add(parseCodeableReference(xpp));
5205    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
5206      res.getAccount().add(parseReference(xpp));
5207    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5208      res.getNote().add(parseAnnotation(xpp));
5209    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
5210      res.getSupportingInformation().add(parseReference(xpp));
5211    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
5212      return false;
5213    }
5214    return true;
5215  }
5216
5217  protected ChargeItem.ChargeItemPerformerComponent parseChargeItemPerformerComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5218    ChargeItem.ChargeItemPerformerComponent res = new ChargeItem.ChargeItemPerformerComponent();
5219    parseElementAttributes(xpp, res);
5220    next(xpp);
5221    int eventType = nextNoWhitespace(xpp);
5222    while (eventType != XmlPullParser.END_TAG) {
5223    if (!parseChargeItemPerformerComponentContent(eventType, xpp, res))
5224        unknownContent(xpp);
5225      eventType = nextNoWhitespace(xpp);
5226    }
5227    next(xpp);
5228    parseElementClose(res);
5229    return res;
5230  }
5231
5232  protected boolean parseChargeItemPerformerComponentContent(int eventType, XmlPullParser xpp, ChargeItem.ChargeItemPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5233    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("function")) {
5234      res.setFunction(parseCodeableConcept(xpp));
5235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5236      res.setActor(parseReference(xpp));
5237    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5238      return false;
5239    }
5240    return true;
5241  }
5242
5243  protected ChargeItemDefinition parseChargeItemDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5244    ChargeItemDefinition res = new ChargeItemDefinition();
5245    parseResourceAttributes(xpp, res);
5246    next(xpp);
5247    int eventType = nextNoWhitespace(xpp);
5248    while (eventType != XmlPullParser.END_TAG) {
5249    if (!parseChargeItemDefinitionContent(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 parseChargeItemDefinitionContent(int eventType, XmlPullParser xpp, ChargeItemDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
5259    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5260      res.setUrlElement(parseUri(xpp));
5261    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5262      res.getIdentifier().add(parseIdentifier(xpp));
5263    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5264      res.setVersionElement(parseString(xpp));
5265    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
5266      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
5267    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5268      res.setNameElement(parseString(xpp));
5269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5270      res.setTitleElement(parseString(xpp));
5271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("derivedFromUri")) {
5272      res.getDerivedFromUri().add(parseUri(xpp));
5273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
5274      res.getPartOf().add(parseCanonical(xpp));
5275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
5276      res.getReplaces().add(parseCanonical(xpp));
5277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5278      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5280      res.setExperimentalElement(parseBoolean(xpp));
5281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5282      res.setDateElement(parseDateTime(xpp));
5283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5284      res.setPublisherElement(parseString(xpp));
5285    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5286      res.getContact().add(parseContactDetail(xpp));
5287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5288      res.setDescriptionElement(parseMarkdown(xpp));
5289    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5290      res.getUseContext().add(parseUsageContext(xpp));
5291    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5292      res.getJurisdiction().add(parseCodeableConcept(xpp));
5293    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5294      res.setPurposeElement(parseMarkdown(xpp));
5295    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5296      res.setCopyrightElement(parseMarkdown(xpp));
5297    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
5298      res.setCopyrightLabelElement(parseString(xpp));
5299    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
5300      res.setApprovalDateElement(parseDate(xpp));
5301    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
5302      res.setLastReviewDateElement(parseDate(xpp));
5303    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5304      res.setCode(parseCodeableConcept(xpp));
5305    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
5306      res.getInstance().add(parseReference(xpp));
5307    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
5308      res.getApplicability().add(parseChargeItemDefinitionApplicabilityComponent(xpp));
5309    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("propertyGroup")) {
5310      res.getPropertyGroup().add(parseChargeItemDefinitionPropertyGroupComponent(xpp));
5311    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
5312      return false;
5313    }
5314    return true;
5315  }
5316
5317  protected ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent parseChargeItemDefinitionApplicabilityComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5318    ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res = new ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent();
5319    parseElementAttributes(xpp, res);
5320    next(xpp);
5321    int eventType = nextNoWhitespace(xpp);
5322    while (eventType != XmlPullParser.END_TAG) {
5323    if (!parseChargeItemDefinitionApplicabilityComponentContent(eventType, xpp, res))
5324        unknownContent(xpp);
5325      eventType = nextNoWhitespace(xpp);
5326    }
5327    next(xpp);
5328    parseElementClose(res);
5329    return res;
5330  }
5331
5332  protected boolean parseChargeItemDefinitionApplicabilityComponentContent(int eventType, XmlPullParser xpp, ChargeItemDefinition.ChargeItemDefinitionApplicabilityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5333    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
5334      res.setCondition(parseExpression(xpp));
5335    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
5336      res.setEffectivePeriod(parsePeriod(xpp));
5337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
5338      res.setRelatedArtifact(parseRelatedArtifact(xpp));
5339    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5340      return false;
5341    }
5342    return true;
5343  }
5344
5345  protected ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent parseChargeItemDefinitionPropertyGroupComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5346    ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res = new ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent();
5347    parseElementAttributes(xpp, res);
5348    next(xpp);
5349    int eventType = nextNoWhitespace(xpp);
5350    while (eventType != XmlPullParser.END_TAG) {
5351    if (!parseChargeItemDefinitionPropertyGroupComponentContent(eventType, xpp, res))
5352        unknownContent(xpp);
5353      eventType = nextNoWhitespace(xpp);
5354    }
5355    next(xpp);
5356    parseElementClose(res);
5357    return res;
5358  }
5359
5360  protected boolean parseChargeItemDefinitionPropertyGroupComponentContent(int eventType, XmlPullParser xpp, ChargeItemDefinition.ChargeItemDefinitionPropertyGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5361    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
5362      res.getApplicability().add(parseChargeItemDefinitionApplicabilityComponent(xpp));
5363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceComponent")) {
5364      res.getPriceComponent().add(parseMonetaryComponent(xpp));
5365    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5366      return false;
5367    }
5368    return true;
5369  }
5370
5371  protected Citation parseCitation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5372    Citation res = new Citation();
5373    parseResourceAttributes(xpp, res);
5374    next(xpp);
5375    int eventType = nextNoWhitespace(xpp);
5376    while (eventType != XmlPullParser.END_TAG) {
5377    if (!parseCitationContent(eventType, xpp, res))
5378        unknownContent(xpp);
5379      eventType = nextNoWhitespace(xpp);
5380    }
5381    next(xpp);
5382    parseElementClose(res);
5383    return res;
5384  }
5385
5386  protected boolean parseCitationContent(int eventType, XmlPullParser xpp, Citation res) throws XmlPullParserException, IOException, FHIRFormatError {
5387    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5388      res.setUrlElement(parseUri(xpp));
5389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5390      res.getIdentifier().add(parseIdentifier(xpp));
5391    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5392      res.setVersionElement(parseString(xpp));
5393    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
5394      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
5395    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5396      res.setNameElement(parseString(xpp));
5397    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5398      res.setTitleElement(parseString(xpp));
5399    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5400      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5401    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5402      res.setExperimentalElement(parseBoolean(xpp));
5403    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5404      res.setDateElement(parseDateTime(xpp));
5405    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5406      res.setPublisherElement(parseString(xpp));
5407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5408      res.getContact().add(parseContactDetail(xpp));
5409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5410      res.setDescriptionElement(parseMarkdown(xpp));
5411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5412      res.getUseContext().add(parseUsageContext(xpp));
5413    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5414      res.getJurisdiction().add(parseCodeableConcept(xpp));
5415    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5416      res.setPurposeElement(parseMarkdown(xpp));
5417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5418      res.setCopyrightElement(parseMarkdown(xpp));
5419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
5420      res.setCopyrightLabelElement(parseString(xpp));
5421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
5422      res.setApprovalDateElement(parseDate(xpp));
5423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
5424      res.setLastReviewDateElement(parseDate(xpp));
5425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
5426      res.setEffectivePeriod(parsePeriod(xpp));
5427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
5428      res.getAuthor().add(parseContactDetail(xpp));
5429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
5430      res.getEditor().add(parseContactDetail(xpp));
5431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
5432      res.getReviewer().add(parseContactDetail(xpp));
5433    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
5434      res.getEndorser().add(parseContactDetail(xpp));
5435    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5436      res.getSummary().add(parseCitationSummaryComponent(xpp));
5437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
5438      res.getClassification().add(parseCitationClassificationComponent(xpp));
5439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5440      res.getNote().add(parseAnnotation(xpp));
5441    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currentState")) {
5442      res.getCurrentState().add(parseCodeableConcept(xpp));
5443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
5444      res.getStatusDate().add(parseCitationStatusDateComponent(xpp));
5445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
5446      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
5447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citedArtifact")) {
5448      res.setCitedArtifact(parseCitationCitedArtifactComponent(xpp));
5449    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
5450      return false;
5451    }
5452    return true;
5453  }
5454
5455  protected Citation.CitationSummaryComponent parseCitationSummaryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5456    Citation.CitationSummaryComponent res = new Citation.CitationSummaryComponent();
5457    parseElementAttributes(xpp, res);
5458    next(xpp);
5459    int eventType = nextNoWhitespace(xpp);
5460    while (eventType != XmlPullParser.END_TAG) {
5461    if (!parseCitationSummaryComponentContent(eventType, xpp, res))
5462        unknownContent(xpp);
5463      eventType = nextNoWhitespace(xpp);
5464    }
5465    next(xpp);
5466    parseElementClose(res);
5467    return res;
5468  }
5469
5470  protected boolean parseCitationSummaryComponentContent(int eventType, XmlPullParser xpp, Citation.CitationSummaryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5471    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("style")) {
5472      res.setStyle(parseCodeableConcept(xpp));
5473    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5474      res.setTextElement(parseMarkdown(xpp));
5475    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5476      return false;
5477    }
5478    return true;
5479  }
5480
5481  protected Citation.CitationClassificationComponent parseCitationClassificationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5482    Citation.CitationClassificationComponent res = new Citation.CitationClassificationComponent();
5483    parseElementAttributes(xpp, res);
5484    next(xpp);
5485    int eventType = nextNoWhitespace(xpp);
5486    while (eventType != XmlPullParser.END_TAG) {
5487    if (!parseCitationClassificationComponentContent(eventType, xpp, res))
5488        unknownContent(xpp);
5489      eventType = nextNoWhitespace(xpp);
5490    }
5491    next(xpp);
5492    parseElementClose(res);
5493    return res;
5494  }
5495
5496  protected boolean parseCitationClassificationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationClassificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5497    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5498      res.setType(parseCodeableConcept(xpp));
5499    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5500      res.getClassifier().add(parseCodeableConcept(xpp));
5501    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5502      return false;
5503    }
5504    return true;
5505  }
5506
5507  protected Citation.CitationStatusDateComponent parseCitationStatusDateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5508    Citation.CitationStatusDateComponent res = new Citation.CitationStatusDateComponent();
5509    parseElementAttributes(xpp, res);
5510    next(xpp);
5511    int eventType = nextNoWhitespace(xpp);
5512    while (eventType != XmlPullParser.END_TAG) {
5513    if (!parseCitationStatusDateComponentContent(eventType, xpp, res))
5514        unknownContent(xpp);
5515      eventType = nextNoWhitespace(xpp);
5516    }
5517    next(xpp);
5518    parseElementClose(res);
5519    return res;
5520  }
5521
5522  protected boolean parseCitationStatusDateComponentContent(int eventType, XmlPullParser xpp, Citation.CitationStatusDateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5523    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
5524      res.setActivity(parseCodeableConcept(xpp));
5525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actual")) {
5526      res.setActualElement(parseBoolean(xpp));
5527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5528      res.setPeriod(parsePeriod(xpp));
5529    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5530      return false;
5531    }
5532    return true;
5533  }
5534
5535  protected Citation.CitationCitedArtifactComponent parseCitationCitedArtifactComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5536    Citation.CitationCitedArtifactComponent res = new Citation.CitationCitedArtifactComponent();
5537    parseElementAttributes(xpp, res);
5538    next(xpp);
5539    int eventType = nextNoWhitespace(xpp);
5540    while (eventType != XmlPullParser.END_TAG) {
5541    if (!parseCitationCitedArtifactComponentContent(eventType, xpp, res))
5542        unknownContent(xpp);
5543      eventType = nextNoWhitespace(xpp);
5544    }
5545    next(xpp);
5546    parseElementClose(res);
5547    return res;
5548  }
5549
5550  protected boolean parseCitationCitedArtifactComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5551    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5552      res.getIdentifier().add(parseIdentifier(xpp));
5553    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedIdentifier")) {
5554      res.getRelatedIdentifier().add(parseIdentifier(xpp));
5555    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateAccessed")) {
5556      res.setDateAccessedElement(parseDateTime(xpp));
5557    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5558      res.setVersion(parseCitationCitedArtifactVersionComponent(xpp));
5559    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("currentState")) {
5560      res.getCurrentState().add(parseCodeableConcept(xpp));
5561    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusDate")) {
5562      res.getStatusDate().add(parseCitationCitedArtifactStatusDateComponent(xpp));
5563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5564      res.getTitle().add(parseCitationCitedArtifactTitleComponent(xpp));
5565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("abstract")) {
5566      res.getAbstract().add(parseCitationCitedArtifactAbstractComponent(xpp));
5567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
5568      res.setPart(parseCitationCitedArtifactPartComponent(xpp));
5569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
5570      res.getRelatesTo().add(parseCitationCitedArtifactRelatesToComponent(xpp));
5571    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationForm")) {
5572      res.getPublicationForm().add(parseCitationCitedArtifactPublicationFormComponent(xpp));
5573    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("webLocation")) {
5574      res.getWebLocation().add(parseCitationCitedArtifactWebLocationComponent(xpp));
5575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
5576      res.getClassification().add(parseCitationCitedArtifactClassificationComponent(xpp));
5577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributorship")) {
5578      res.setContributorship(parseCitationCitedArtifactContributorshipComponent(xpp));
5579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5580      res.getNote().add(parseAnnotation(xpp));
5581    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5582      return false;
5583    }
5584    return true;
5585  }
5586
5587  protected Citation.CitationCitedArtifactVersionComponent parseCitationCitedArtifactVersionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5588    Citation.CitationCitedArtifactVersionComponent res = new Citation.CitationCitedArtifactVersionComponent();
5589    parseElementAttributes(xpp, res);
5590    next(xpp);
5591    int eventType = nextNoWhitespace(xpp);
5592    while (eventType != XmlPullParser.END_TAG) {
5593    if (!parseCitationCitedArtifactVersionComponentContent(eventType, xpp, res))
5594        unknownContent(xpp);
5595      eventType = nextNoWhitespace(xpp);
5596    }
5597    next(xpp);
5598    parseElementClose(res);
5599    return res;
5600  }
5601
5602  protected boolean parseCitationCitedArtifactVersionComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactVersionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5603    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
5604      res.setValueElement(parseString(xpp));
5605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseCitation")) {
5606      res.setBaseCitation(parseReference(xpp));
5607    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5608      return false;
5609    }
5610    return true;
5611  }
5612
5613  protected Citation.CitationCitedArtifactStatusDateComponent parseCitationCitedArtifactStatusDateComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5614    Citation.CitationCitedArtifactStatusDateComponent res = new Citation.CitationCitedArtifactStatusDateComponent();
5615    parseElementAttributes(xpp, res);
5616    next(xpp);
5617    int eventType = nextNoWhitespace(xpp);
5618    while (eventType != XmlPullParser.END_TAG) {
5619    if (!parseCitationCitedArtifactStatusDateComponentContent(eventType, xpp, res))
5620        unknownContent(xpp);
5621      eventType = nextNoWhitespace(xpp);
5622    }
5623    next(xpp);
5624    parseElementClose(res);
5625    return res;
5626  }
5627
5628  protected boolean parseCitationCitedArtifactStatusDateComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactStatusDateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5629    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
5630      res.setActivity(parseCodeableConcept(xpp));
5631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actual")) {
5632      res.setActualElement(parseBoolean(xpp));
5633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5634      res.setPeriod(parsePeriod(xpp));
5635    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5636      return false;
5637    }
5638    return true;
5639  }
5640
5641  protected Citation.CitationCitedArtifactTitleComponent parseCitationCitedArtifactTitleComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5642    Citation.CitationCitedArtifactTitleComponent res = new Citation.CitationCitedArtifactTitleComponent();
5643    parseElementAttributes(xpp, res);
5644    next(xpp);
5645    int eventType = nextNoWhitespace(xpp);
5646    while (eventType != XmlPullParser.END_TAG) {
5647    if (!parseCitationCitedArtifactTitleComponentContent(eventType, xpp, res))
5648        unknownContent(xpp);
5649      eventType = nextNoWhitespace(xpp);
5650    }
5651    next(xpp);
5652    parseElementClose(res);
5653    return res;
5654  }
5655
5656  protected boolean parseCitationCitedArtifactTitleComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactTitleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5657    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5658      res.getType().add(parseCodeableConcept(xpp));
5659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5660      res.setLanguage(parseCodeableConcept(xpp));
5661    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5662      res.setTextElement(parseMarkdown(xpp));
5663    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5664      return false;
5665    }
5666    return true;
5667  }
5668
5669  protected Citation.CitationCitedArtifactAbstractComponent parseCitationCitedArtifactAbstractComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5670    Citation.CitationCitedArtifactAbstractComponent res = new Citation.CitationCitedArtifactAbstractComponent();
5671    parseElementAttributes(xpp, res);
5672    next(xpp);
5673    int eventType = nextNoWhitespace(xpp);
5674    while (eventType != XmlPullParser.END_TAG) {
5675    if (!parseCitationCitedArtifactAbstractComponentContent(eventType, xpp, res))
5676        unknownContent(xpp);
5677      eventType = nextNoWhitespace(xpp);
5678    }
5679    next(xpp);
5680    parseElementClose(res);
5681    return res;
5682  }
5683
5684  protected boolean parseCitationCitedArtifactAbstractComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactAbstractComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5685    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5686      res.setType(parseCodeableConcept(xpp));
5687    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5688      res.setLanguage(parseCodeableConcept(xpp));
5689    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5690      res.setTextElement(parseMarkdown(xpp));
5691    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5692      res.setCopyrightElement(parseMarkdown(xpp));
5693    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5694      return false;
5695    }
5696    return true;
5697  }
5698
5699  protected Citation.CitationCitedArtifactPartComponent parseCitationCitedArtifactPartComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5700    Citation.CitationCitedArtifactPartComponent res = new Citation.CitationCitedArtifactPartComponent();
5701    parseElementAttributes(xpp, res);
5702    next(xpp);
5703    int eventType = nextNoWhitespace(xpp);
5704    while (eventType != XmlPullParser.END_TAG) {
5705    if (!parseCitationCitedArtifactPartComponentContent(eventType, xpp, res))
5706        unknownContent(xpp);
5707      eventType = nextNoWhitespace(xpp);
5708    }
5709    next(xpp);
5710    parseElementClose(res);
5711    return res;
5712  }
5713
5714  protected boolean parseCitationCitedArtifactPartComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPartComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5715    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5716      res.setType(parseCodeableConcept(xpp));
5717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
5718      res.setValueElement(parseString(xpp));
5719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("baseCitation")) {
5720      res.setBaseCitation(parseReference(xpp));
5721    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5722      return false;
5723    }
5724    return true;
5725  }
5726
5727  protected Citation.CitationCitedArtifactRelatesToComponent parseCitationCitedArtifactRelatesToComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5728    Citation.CitationCitedArtifactRelatesToComponent res = new Citation.CitationCitedArtifactRelatesToComponent();
5729    parseElementAttributes(xpp, res);
5730    next(xpp);
5731    int eventType = nextNoWhitespace(xpp);
5732    while (eventType != XmlPullParser.END_TAG) {
5733    if (!parseCitationCitedArtifactRelatesToComponentContent(eventType, xpp, res))
5734        unknownContent(xpp);
5735      eventType = nextNoWhitespace(xpp);
5736    }
5737    next(xpp);
5738    parseElementClose(res);
5739    return res;
5740  }
5741
5742  protected boolean parseCitationCitedArtifactRelatesToComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5743    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5744      res.setTypeElement(parseEnumeration(xpp, Citation.RelatedArtifactTypeExpanded.NULL, new Citation.RelatedArtifactTypeExpandedEnumFactory()));
5745    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5746      res.getClassifier().add(parseCodeableConcept(xpp));
5747    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
5748      res.setLabelElement(parseString(xpp));
5749    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5750      res.setDisplayElement(parseString(xpp));
5751    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
5752      res.setCitationElement(parseMarkdown(xpp));
5753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
5754      res.setDocument(parseAttachment(xpp));
5755    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
5756      res.setResourceElement(parseCanonical(xpp));
5757    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceReference")) {
5758      res.setResourceReference(parseReference(xpp));
5759    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5760      return false;
5761    }
5762    return true;
5763  }
5764
5765  protected Citation.CitationCitedArtifactPublicationFormComponent parseCitationCitedArtifactPublicationFormComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5766    Citation.CitationCitedArtifactPublicationFormComponent res = new Citation.CitationCitedArtifactPublicationFormComponent();
5767    parseElementAttributes(xpp, res);
5768    next(xpp);
5769    int eventType = nextNoWhitespace(xpp);
5770    while (eventType != XmlPullParser.END_TAG) {
5771    if (!parseCitationCitedArtifactPublicationFormComponentContent(eventType, xpp, res))
5772        unknownContent(xpp);
5773      eventType = nextNoWhitespace(xpp);
5774    }
5775    next(xpp);
5776    parseElementClose(res);
5777    return res;
5778  }
5779
5780  protected boolean parseCitationCitedArtifactPublicationFormComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5781    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publishedIn")) {
5782      res.setPublishedIn(parseCitationCitedArtifactPublicationFormPublishedInComponent(xpp));
5783    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citedMedium")) {
5784      res.setCitedMedium(parseCodeableConcept(xpp));
5785    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("volume")) {
5786      res.setVolumeElement(parseString(xpp));
5787    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issue")) {
5788      res.setIssueElement(parseString(xpp));
5789    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("articleDate")) {
5790      res.setArticleDateElement(parseDateTime(xpp));
5791    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationDateText")) {
5792      res.setPublicationDateTextElement(parseString(xpp));
5793    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publicationDateSeason")) {
5794      res.setPublicationDateSeasonElement(parseString(xpp));
5795    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastRevisionDate")) {
5796      res.setLastRevisionDateElement(parseDateTime(xpp));
5797    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
5798      res.getLanguage().add(parseCodeableConcept(xpp));
5799    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accessionNumber")) {
5800      res.setAccessionNumberElement(parseString(xpp));
5801    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pageString")) {
5802      res.setPageStringElement(parseString(xpp));
5803    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("firstPage")) {
5804      res.setFirstPageElement(parseString(xpp));
5805    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastPage")) {
5806      res.setLastPageElement(parseString(xpp));
5807    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("pageCount")) {
5808      res.setPageCountElement(parseString(xpp));
5809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5810      res.setCopyrightElement(parseMarkdown(xpp));
5811    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5812      return false;
5813    }
5814    return true;
5815  }
5816
5817  protected Citation.CitationCitedArtifactPublicationFormPublishedInComponent parseCitationCitedArtifactPublicationFormPublishedInComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5818    Citation.CitationCitedArtifactPublicationFormPublishedInComponent res = new Citation.CitationCitedArtifactPublicationFormPublishedInComponent();
5819    parseElementAttributes(xpp, res);
5820    next(xpp);
5821    int eventType = nextNoWhitespace(xpp);
5822    while (eventType != XmlPullParser.END_TAG) {
5823    if (!parseCitationCitedArtifactPublicationFormPublishedInComponentContent(eventType, xpp, res))
5824        unknownContent(xpp);
5825      eventType = nextNoWhitespace(xpp);
5826    }
5827    next(xpp);
5828    parseElementClose(res);
5829    return res;
5830  }
5831
5832  protected boolean parseCitationCitedArtifactPublicationFormPublishedInComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactPublicationFormPublishedInComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5833    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5834      res.setType(parseCodeableConcept(xpp));
5835    } else 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("title")) {
5838      res.setTitleElement(parseString(xpp));
5839    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5840      res.setPublisher(parseReference(xpp));
5841    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisherLocation")) {
5842      res.setPublisherLocationElement(parseString(xpp));
5843    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5844      return false;
5845    }
5846    return true;
5847  }
5848
5849  protected Citation.CitationCitedArtifactWebLocationComponent parseCitationCitedArtifactWebLocationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5850    Citation.CitationCitedArtifactWebLocationComponent res = new Citation.CitationCitedArtifactWebLocationComponent();
5851    parseElementAttributes(xpp, res);
5852    next(xpp);
5853    int eventType = nextNoWhitespace(xpp);
5854    while (eventType != XmlPullParser.END_TAG) {
5855    if (!parseCitationCitedArtifactWebLocationComponentContent(eventType, xpp, res))
5856        unknownContent(xpp);
5857      eventType = nextNoWhitespace(xpp);
5858    }
5859    next(xpp);
5860    parseElementClose(res);
5861    return res;
5862  }
5863
5864  protected boolean parseCitationCitedArtifactWebLocationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactWebLocationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5865    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5866      res.getClassifier().add(parseCodeableConcept(xpp));
5867    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5868      res.setUrlElement(parseUri(xpp));
5869    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5870      return false;
5871    }
5872    return true;
5873  }
5874
5875  protected Citation.CitationCitedArtifactClassificationComponent parseCitationCitedArtifactClassificationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5876    Citation.CitationCitedArtifactClassificationComponent res = new Citation.CitationCitedArtifactClassificationComponent();
5877    parseElementAttributes(xpp, res);
5878    next(xpp);
5879    int eventType = nextNoWhitespace(xpp);
5880    while (eventType != XmlPullParser.END_TAG) {
5881    if (!parseCitationCitedArtifactClassificationComponentContent(eventType, xpp, res))
5882        unknownContent(xpp);
5883      eventType = nextNoWhitespace(xpp);
5884    }
5885    next(xpp);
5886    parseElementClose(res);
5887    return res;
5888  }
5889
5890  protected boolean parseCitationCitedArtifactClassificationComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactClassificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5891    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5892      res.setType(parseCodeableConcept(xpp));
5893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classifier")) {
5894      res.getClassifier().add(parseCodeableConcept(xpp));
5895    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("artifactAssessment")) {
5896      res.getArtifactAssessment().add(parseReference(xpp));
5897    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5898      return false;
5899    }
5900    return true;
5901  }
5902
5903  protected Citation.CitationCitedArtifactContributorshipComponent parseCitationCitedArtifactContributorshipComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5904    Citation.CitationCitedArtifactContributorshipComponent res = new Citation.CitationCitedArtifactContributorshipComponent();
5905    parseElementAttributes(xpp, res);
5906    next(xpp);
5907    int eventType = nextNoWhitespace(xpp);
5908    while (eventType != XmlPullParser.END_TAG) {
5909    if (!parseCitationCitedArtifactContributorshipComponentContent(eventType, xpp, res))
5910        unknownContent(xpp);
5911      eventType = nextNoWhitespace(xpp);
5912    }
5913    next(xpp);
5914    parseElementClose(res);
5915    return res;
5916  }
5917
5918  protected boolean parseCitationCitedArtifactContributorshipComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5919    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("complete")) {
5920      res.setCompleteElement(parseBoolean(xpp));
5921    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
5922      res.getEntry().add(parseCitationCitedArtifactContributorshipEntryComponent(xpp));
5923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5924      res.getSummary().add(parseCitationContributorshipSummaryComponent(xpp));
5925    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5926      return false;
5927    }
5928    return true;
5929  }
5930
5931  protected Citation.CitationCitedArtifactContributorshipEntryComponent parseCitationCitedArtifactContributorshipEntryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5932    Citation.CitationCitedArtifactContributorshipEntryComponent res = new Citation.CitationCitedArtifactContributorshipEntryComponent();
5933    parseElementAttributes(xpp, res);
5934    next(xpp);
5935    int eventType = nextNoWhitespace(xpp);
5936    while (eventType != XmlPullParser.END_TAG) {
5937    if (!parseCitationCitedArtifactContributorshipEntryComponentContent(eventType, xpp, res))
5938        unknownContent(xpp);
5939      eventType = nextNoWhitespace(xpp);
5940    }
5941    next(xpp);
5942    parseElementClose(res);
5943    return res;
5944  }
5945
5946  protected boolean parseCitationCitedArtifactContributorshipEntryComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5947    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
5948      res.setContributor(parseReference(xpp));
5949    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("forenameInitials")) {
5950      res.setForenameInitialsElement(parseString(xpp));
5951    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("affiliation")) {
5952      res.getAffiliation().add(parseReference(xpp));
5953    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributionType")) {
5954      res.getContributionType().add(parseCodeableConcept(xpp));
5955    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5956      res.setRole(parseCodeableConcept(xpp));
5957    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributionInstance")) {
5958      res.getContributionInstance().add(parseCitationCitedArtifactContributorshipEntryContributionInstanceComponent(xpp));
5959    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("correspondingContact")) {
5960      res.setCorrespondingContactElement(parseBoolean(xpp));
5961    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rankingOrder")) {
5962      res.setRankingOrderElement(parsePositiveInt(xpp));
5963    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5964      return false;
5965    }
5966    return true;
5967  }
5968
5969  protected Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent parseCitationCitedArtifactContributorshipEntryContributionInstanceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5970    Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent res = new Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent();
5971    parseElementAttributes(xpp, res);
5972    next(xpp);
5973    int eventType = nextNoWhitespace(xpp);
5974    while (eventType != XmlPullParser.END_TAG) {
5975    if (!parseCitationCitedArtifactContributorshipEntryContributionInstanceComponentContent(eventType, xpp, res))
5976        unknownContent(xpp);
5977      eventType = nextNoWhitespace(xpp);
5978    }
5979    next(xpp);
5980    parseElementClose(res);
5981    return res;
5982  }
5983
5984  protected boolean parseCitationCitedArtifactContributorshipEntryContributionInstanceComponentContent(int eventType, XmlPullParser xpp, Citation.CitationCitedArtifactContributorshipEntryContributionInstanceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5985    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5986      res.setType(parseCodeableConcept(xpp));
5987    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
5988      res.setTimeElement(parseDateTime(xpp));
5989    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
5990      return false;
5991    }
5992    return true;
5993  }
5994
5995  protected Citation.ContributorshipSummaryComponent parseCitationContributorshipSummaryComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5996    Citation.ContributorshipSummaryComponent res = new Citation.ContributorshipSummaryComponent();
5997    parseElementAttributes(xpp, res);
5998    next(xpp);
5999    int eventType = nextNoWhitespace(xpp);
6000    while (eventType != XmlPullParser.END_TAG) {
6001    if (!parseCitationContributorshipSummaryComponentContent(eventType, xpp, res))
6002        unknownContent(xpp);
6003      eventType = nextNoWhitespace(xpp);
6004    }
6005    next(xpp);
6006    parseElementClose(res);
6007    return res;
6008  }
6009
6010  protected boolean parseCitationContributorshipSummaryComponentContent(int eventType, XmlPullParser xpp, Citation.ContributorshipSummaryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6011    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6012      res.setType(parseCodeableConcept(xpp));
6013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("style")) {
6014      res.setStyle(parseCodeableConcept(xpp));
6015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6016      res.setSource(parseCodeableConcept(xpp));
6017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
6018      res.setValueElement(parseMarkdown(xpp));
6019    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6020      return false;
6021    }
6022    return true;
6023  }
6024
6025  protected Claim parseClaim(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6026    Claim res = new Claim();
6027    parseResourceAttributes(xpp, res);
6028    next(xpp);
6029    int eventType = nextNoWhitespace(xpp);
6030    while (eventType != XmlPullParser.END_TAG) {
6031    if (!parseClaimContent(eventType, xpp, res))
6032        unknownContent(xpp);
6033      eventType = nextNoWhitespace(xpp);
6034    }
6035    next(xpp);
6036    parseElementClose(res);
6037    return res;
6038  }
6039
6040  protected boolean parseClaimContent(int eventType, XmlPullParser xpp, Claim res) throws XmlPullParserException, IOException, FHIRFormatError {
6041    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6042      res.getIdentifier().add(parseIdentifier(xpp));
6043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6044      res.getTraceNumber().add(parseIdentifier(xpp));
6045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6046      res.setStatusElement(parseEnumeration(xpp, Enumerations.FinancialResourceStatusCodes.NULL, new Enumerations.FinancialResourceStatusCodesEnumFactory()));
6047    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6048      res.setType(parseCodeableConcept(xpp));
6049    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
6050      res.setSubType(parseCodeableConcept(xpp));
6051    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
6052      res.setUseElement(parseEnumeration(xpp, Enumerations.Use.NULL, new Enumerations.UseEnumFactory()));
6053    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6054      res.setPatient(parseReference(xpp));
6055    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
6056      res.setBillablePeriod(parsePeriod(xpp));
6057    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6058      res.setCreatedElement(parseDateTime(xpp));
6059    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
6060      res.setEnterer(parseReference(xpp));
6061    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
6062      res.setInsurer(parseReference(xpp));
6063    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
6064      res.setProvider(parseReference(xpp));
6065    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
6066      res.setPriority(parseCodeableConcept(xpp));
6067    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
6068      res.setFundsReserve(parseCodeableConcept(xpp));
6069    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
6070      res.getRelated().add(parseClaimRelatedClaimComponent(xpp));
6071    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
6072      res.setPrescription(parseReference(xpp));
6073    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
6074      res.setOriginalPrescription(parseReference(xpp));
6075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
6076      res.setPayee(parseClaimPayeeComponent(xpp));
6077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
6078      res.setReferral(parseReference(xpp));
6079    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
6080      res.getEncounter().add(parseReference(xpp));
6081    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
6082      res.setFacility(parseReference(xpp));
6083    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisRelatedGroup")) {
6084      res.setDiagnosisRelatedGroup(parseCodeableConcept(xpp));
6085    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
6086      res.getEvent().add(parseClaimEventComponent(xpp));
6087    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
6088      res.getCareTeam().add(parseClaimCareTeamComponent(xpp));
6089    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
6090      res.getSupportingInfo().add(parseClaimSupportingInformationComponent(xpp));
6091    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
6092      res.getDiagnosis().add(parseClaimDiagnosisComponent(xpp));
6093    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
6094      res.getProcedure().add(parseClaimProcedureComponent(xpp));
6095    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
6096      res.getInsurance().add(parseClaimInsuranceComponent(xpp));
6097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
6098      res.setAccident(parseClaimAccidentComponent(xpp));
6099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientPaid")) {
6100      res.setPatientPaid(parseMoney(xpp));
6101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
6102      res.getItem().add(parseClaimItemComponent(xpp));
6103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
6104      res.setTotal(parseMoney(xpp));
6105    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
6106      return false;
6107    }
6108    return true;
6109  }
6110
6111  protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6112    Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent();
6113    parseElementAttributes(xpp, res);
6114    next(xpp);
6115    int eventType = nextNoWhitespace(xpp);
6116    while (eventType != XmlPullParser.END_TAG) {
6117    if (!parseClaimRelatedClaimComponentContent(eventType, xpp, res))
6118        unknownContent(xpp);
6119      eventType = nextNoWhitespace(xpp);
6120    }
6121    next(xpp);
6122    parseElementClose(res);
6123    return res;
6124  }
6125
6126  protected boolean parseClaimRelatedClaimComponentContent(int eventType, XmlPullParser xpp, Claim.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6127    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
6128      res.setClaim(parseReference(xpp));
6129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
6130      res.setRelationship(parseCodeableConcept(xpp));
6131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
6132      res.setReference(parseIdentifier(xpp));
6133    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6134      return false;
6135    }
6136    return true;
6137  }
6138
6139  protected Claim.PayeeComponent parseClaimPayeeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6140    Claim.PayeeComponent res = new Claim.PayeeComponent();
6141    parseElementAttributes(xpp, res);
6142    next(xpp);
6143    int eventType = nextNoWhitespace(xpp);
6144    while (eventType != XmlPullParser.END_TAG) {
6145    if (!parseClaimPayeeComponentContent(eventType, xpp, res))
6146        unknownContent(xpp);
6147      eventType = nextNoWhitespace(xpp);
6148    }
6149    next(xpp);
6150    parseElementClose(res);
6151    return res;
6152  }
6153
6154  protected boolean parseClaimPayeeComponentContent(int eventType, XmlPullParser xpp, Claim.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6155    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6156      res.setType(parseCodeableConcept(xpp));
6157    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
6158      res.setParty(parseReference(xpp));
6159    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6160      return false;
6161    }
6162    return true;
6163  }
6164
6165  protected Claim.ClaimEventComponent parseClaimEventComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6166    Claim.ClaimEventComponent res = new Claim.ClaimEventComponent();
6167    parseElementAttributes(xpp, res);
6168    next(xpp);
6169    int eventType = nextNoWhitespace(xpp);
6170    while (eventType != XmlPullParser.END_TAG) {
6171    if (!parseClaimEventComponentContent(eventType, xpp, res))
6172        unknownContent(xpp);
6173      eventType = nextNoWhitespace(xpp);
6174    }
6175    next(xpp);
6176    parseElementClose(res);
6177    return res;
6178  }
6179
6180  protected boolean parseClaimEventComponentContent(int eventType, XmlPullParser xpp, Claim.ClaimEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6181    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6182      res.setType(parseCodeableConcept(xpp));
6183    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "when")) {
6184      res.setWhen(parseType("when", xpp));
6185    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6186      return false;
6187    }
6188    return true;
6189  }
6190
6191  protected Claim.CareTeamComponent parseClaimCareTeamComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6192    Claim.CareTeamComponent res = new Claim.CareTeamComponent();
6193    parseElementAttributes(xpp, res);
6194    next(xpp);
6195    int eventType = nextNoWhitespace(xpp);
6196    while (eventType != XmlPullParser.END_TAG) {
6197    if (!parseClaimCareTeamComponentContent(eventType, xpp, res))
6198        unknownContent(xpp);
6199      eventType = nextNoWhitespace(xpp);
6200    }
6201    next(xpp);
6202    parseElementClose(res);
6203    return res;
6204  }
6205
6206  protected boolean parseClaimCareTeamComponentContent(int eventType, XmlPullParser xpp, Claim.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6207    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6208      res.setSequenceElement(parsePositiveInt(xpp));
6209    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
6210      res.setProvider(parseReference(xpp));
6211    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
6212      res.setResponsibleElement(parseBoolean(xpp));
6213    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6214      res.setRole(parseCodeableConcept(xpp));
6215    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
6216      res.setSpecialty(parseCodeableConcept(xpp));
6217    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6218      return false;
6219    }
6220    return true;
6221  }
6222
6223  protected Claim.SupportingInformationComponent parseClaimSupportingInformationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6224    Claim.SupportingInformationComponent res = new Claim.SupportingInformationComponent();
6225    parseElementAttributes(xpp, res);
6226    next(xpp);
6227    int eventType = nextNoWhitespace(xpp);
6228    while (eventType != XmlPullParser.END_TAG) {
6229    if (!parseClaimSupportingInformationComponentContent(eventType, xpp, res))
6230        unknownContent(xpp);
6231      eventType = nextNoWhitespace(xpp);
6232    }
6233    next(xpp);
6234    parseElementClose(res);
6235    return res;
6236  }
6237
6238  protected boolean parseClaimSupportingInformationComponentContent(int eventType, XmlPullParser xpp, Claim.SupportingInformationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6239    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6240      res.setSequenceElement(parsePositiveInt(xpp));
6241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6242      res.setCategory(parseCodeableConcept(xpp));
6243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6244      res.setCode(parseCodeableConcept(xpp));
6245    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
6246      res.setTiming(parseType("timing", xpp));
6247    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
6248      res.setValue(parseType("value", xpp));
6249    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
6250      res.setReason(parseCodeableConcept(xpp));
6251    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6252      return false;
6253    }
6254    return true;
6255  }
6256
6257  protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6258    Claim.DiagnosisComponent res = new Claim.DiagnosisComponent();
6259    parseElementAttributes(xpp, res);
6260    next(xpp);
6261    int eventType = nextNoWhitespace(xpp);
6262    while (eventType != XmlPullParser.END_TAG) {
6263    if (!parseClaimDiagnosisComponentContent(eventType, xpp, res))
6264        unknownContent(xpp);
6265      eventType = nextNoWhitespace(xpp);
6266    }
6267    next(xpp);
6268    parseElementClose(res);
6269    return res;
6270  }
6271
6272  protected boolean parseClaimDiagnosisComponentContent(int eventType, XmlPullParser xpp, Claim.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6273    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6274      res.setSequenceElement(parsePositiveInt(xpp));
6275    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
6276      res.setDiagnosis(parseType("diagnosis", xpp));
6277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6278      res.getType().add(parseCodeableConcept(xpp));
6279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onAdmission")) {
6280      res.setOnAdmission(parseCodeableConcept(xpp));
6281    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6282      return false;
6283    }
6284    return true;
6285  }
6286
6287  protected Claim.ProcedureComponent parseClaimProcedureComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6288    Claim.ProcedureComponent res = new Claim.ProcedureComponent();
6289    parseElementAttributes(xpp, res);
6290    next(xpp);
6291    int eventType = nextNoWhitespace(xpp);
6292    while (eventType != XmlPullParser.END_TAG) {
6293    if (!parseClaimProcedureComponentContent(eventType, xpp, res))
6294        unknownContent(xpp);
6295      eventType = nextNoWhitespace(xpp);
6296    }
6297    next(xpp);
6298    parseElementClose(res);
6299    return res;
6300  }
6301
6302  protected boolean parseClaimProcedureComponentContent(int eventType, XmlPullParser xpp, Claim.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6303    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6304      res.setSequenceElement(parsePositiveInt(xpp));
6305    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6306      res.getType().add(parseCodeableConcept(xpp));
6307    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6308      res.setDateElement(parseDateTime(xpp));
6309    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
6310      res.setProcedure(parseType("procedure", xpp));
6311    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6312      res.getUdi().add(parseReference(xpp));
6313    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6314      return false;
6315    }
6316    return true;
6317  }
6318
6319  protected Claim.InsuranceComponent parseClaimInsuranceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6320    Claim.InsuranceComponent res = new Claim.InsuranceComponent();
6321    parseElementAttributes(xpp, res);
6322    next(xpp);
6323    int eventType = nextNoWhitespace(xpp);
6324    while (eventType != XmlPullParser.END_TAG) {
6325    if (!parseClaimInsuranceComponentContent(eventType, xpp, res))
6326        unknownContent(xpp);
6327      eventType = nextNoWhitespace(xpp);
6328    }
6329    next(xpp);
6330    parseElementClose(res);
6331    return res;
6332  }
6333
6334  protected boolean parseClaimInsuranceComponentContent(int eventType, XmlPullParser xpp, Claim.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6335    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6336      res.setSequenceElement(parsePositiveInt(xpp));
6337    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
6338      res.setFocalElement(parseBoolean(xpp));
6339    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6340      res.setIdentifier(parseIdentifier(xpp));
6341    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
6342      res.setCoverage(parseReference(xpp));
6343    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
6344      res.setBusinessArrangementElement(parseString(xpp));
6345    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
6346      res.getPreAuthRef().add(parseString(xpp));
6347    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
6348      res.setClaimResponse(parseReference(xpp));
6349    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6350      return false;
6351    }
6352    return true;
6353  }
6354
6355  protected Claim.AccidentComponent parseClaimAccidentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6356    Claim.AccidentComponent res = new Claim.AccidentComponent();
6357    parseElementAttributes(xpp, res);
6358    next(xpp);
6359    int eventType = nextNoWhitespace(xpp);
6360    while (eventType != XmlPullParser.END_TAG) {
6361    if (!parseClaimAccidentComponentContent(eventType, xpp, res))
6362        unknownContent(xpp);
6363      eventType = nextNoWhitespace(xpp);
6364    }
6365    next(xpp);
6366    parseElementClose(res);
6367    return res;
6368  }
6369
6370  protected boolean parseClaimAccidentComponentContent(int eventType, XmlPullParser xpp, Claim.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6371    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6372      res.setDateElement(parseDate(xpp));
6373    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6374      res.setType(parseCodeableConcept(xpp));
6375    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6376      res.setLocation(parseType("location", xpp));
6377    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6378      return false;
6379    }
6380    return true;
6381  }
6382
6383  protected Claim.ItemComponent parseClaimItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6384    Claim.ItemComponent res = new Claim.ItemComponent();
6385    parseElementAttributes(xpp, res);
6386    next(xpp);
6387    int eventType = nextNoWhitespace(xpp);
6388    while (eventType != XmlPullParser.END_TAG) {
6389    if (!parseClaimItemComponentContent(eventType, xpp, res))
6390        unknownContent(xpp);
6391      eventType = nextNoWhitespace(xpp);
6392    }
6393    next(xpp);
6394    parseElementClose(res);
6395    return res;
6396  }
6397
6398  protected boolean parseClaimItemComponentContent(int eventType, XmlPullParser xpp, Claim.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6399    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6400      res.setSequenceElement(parsePositiveInt(xpp));
6401    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6402      res.getTraceNumber().add(parseIdentifier(xpp));
6403    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamSequence")) {
6404      res.getCareTeamSequence().add(parsePositiveInt(xpp));
6405    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisSequence")) {
6406      res.getDiagnosisSequence().add(parsePositiveInt(xpp));
6407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureSequence")) {
6408      res.getProcedureSequence().add(parsePositiveInt(xpp));
6409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationSequence")) {
6410      res.getInformationSequence().add(parsePositiveInt(xpp));
6411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6412      res.setRevenue(parseCodeableConcept(xpp));
6413    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6414      res.setCategory(parseCodeableConcept(xpp));
6415    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6416      res.setProductOrService(parseCodeableConcept(xpp));
6417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
6418      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
6419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
6420      res.getRequest().add(parseReference(xpp));
6421    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6422      res.getModifier().add(parseCodeableConcept(xpp));
6423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6424      res.getProgramCode().add(parseCodeableConcept(xpp));
6425    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
6426      res.setServiced(parseType("serviced", xpp));
6427    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6428      res.setLocation(parseType("location", xpp));
6429    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientPaid")) {
6430      res.setPatientPaid(parseMoney(xpp));
6431    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6432      res.setQuantity(parseQuantity(xpp));
6433    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6434      res.setUnitPrice(parseMoney(xpp));
6435    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6436      res.setFactorElement(parseDecimal(xpp));
6437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tax")) {
6438      res.setTax(parseMoney(xpp));
6439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6440      res.setNet(parseMoney(xpp));
6441    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6442      res.getUdi().add(parseReference(xpp));
6443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6444      res.getBodySite().add(parseClaimBodySiteComponent(xpp));
6445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
6446      res.getEncounter().add(parseReference(xpp));
6447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6448      res.getDetail().add(parseClaimDetailComponent(xpp));
6449    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6450      return false;
6451    }
6452    return true;
6453  }
6454
6455  protected Claim.BodySiteComponent parseClaimBodySiteComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6456    Claim.BodySiteComponent res = new Claim.BodySiteComponent();
6457    parseElementAttributes(xpp, res);
6458    next(xpp);
6459    int eventType = nextNoWhitespace(xpp);
6460    while (eventType != XmlPullParser.END_TAG) {
6461    if (!parseClaimBodySiteComponentContent(eventType, xpp, res))
6462        unknownContent(xpp);
6463      eventType = nextNoWhitespace(xpp);
6464    }
6465    next(xpp);
6466    parseElementClose(res);
6467    return res;
6468  }
6469
6470  protected boolean parseClaimBodySiteComponentContent(int eventType, XmlPullParser xpp, Claim.BodySiteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6471    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
6472      res.getSite().add(parseCodeableReference(xpp));
6473    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
6474      res.getSubSite().add(parseCodeableConcept(xpp));
6475    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6476      return false;
6477    }
6478    return true;
6479  }
6480
6481  protected Claim.DetailComponent parseClaimDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6482    Claim.DetailComponent res = new Claim.DetailComponent();
6483    parseElementAttributes(xpp, res);
6484    next(xpp);
6485    int eventType = nextNoWhitespace(xpp);
6486    while (eventType != XmlPullParser.END_TAG) {
6487    if (!parseClaimDetailComponentContent(eventType, xpp, res))
6488        unknownContent(xpp);
6489      eventType = nextNoWhitespace(xpp);
6490    }
6491    next(xpp);
6492    parseElementClose(res);
6493    return res;
6494  }
6495
6496  protected boolean parseClaimDetailComponentContent(int eventType, XmlPullParser xpp, Claim.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6497    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6498      res.setSequenceElement(parsePositiveInt(xpp));
6499    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6500      res.getTraceNumber().add(parseIdentifier(xpp));
6501    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6502      res.setRevenue(parseCodeableConcept(xpp));
6503    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6504      res.setCategory(parseCodeableConcept(xpp));
6505    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6506      res.setProductOrService(parseCodeableConcept(xpp));
6507    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
6508      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
6509    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6510      res.getModifier().add(parseCodeableConcept(xpp));
6511    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6512      res.getProgramCode().add(parseCodeableConcept(xpp));
6513    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientPaid")) {
6514      res.setPatientPaid(parseMoney(xpp));
6515    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6516      res.setQuantity(parseQuantity(xpp));
6517    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6518      res.setUnitPrice(parseMoney(xpp));
6519    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6520      res.setFactorElement(parseDecimal(xpp));
6521    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tax")) {
6522      res.setTax(parseMoney(xpp));
6523    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6524      res.setNet(parseMoney(xpp));
6525    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6526      res.getUdi().add(parseReference(xpp));
6527    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6528      res.getSubDetail().add(parseClaimSubDetailComponent(xpp));
6529    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6530      return false;
6531    }
6532    return true;
6533  }
6534
6535  protected Claim.SubDetailComponent parseClaimSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6536    Claim.SubDetailComponent res = new Claim.SubDetailComponent();
6537    parseElementAttributes(xpp, res);
6538    next(xpp);
6539    int eventType = nextNoWhitespace(xpp);
6540    while (eventType != XmlPullParser.END_TAG) {
6541    if (!parseClaimSubDetailComponentContent(eventType, xpp, res))
6542        unknownContent(xpp);
6543      eventType = nextNoWhitespace(xpp);
6544    }
6545    next(xpp);
6546    parseElementClose(res);
6547    return res;
6548  }
6549
6550  protected boolean parseClaimSubDetailComponentContent(int eventType, XmlPullParser xpp, Claim.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6551    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6552      res.setSequenceElement(parsePositiveInt(xpp));
6553    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6554      res.getTraceNumber().add(parseIdentifier(xpp));
6555    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6556      res.setRevenue(parseCodeableConcept(xpp));
6557    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6558      res.setCategory(parseCodeableConcept(xpp));
6559    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6560      res.setProductOrService(parseCodeableConcept(xpp));
6561    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
6562      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
6563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6564      res.getModifier().add(parseCodeableConcept(xpp));
6565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6566      res.getProgramCode().add(parseCodeableConcept(xpp));
6567    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientPaid")) {
6568      res.setPatientPaid(parseMoney(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("tax")) {
6576      res.setTax(parseMoney(xpp));
6577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6578      res.setNet(parseMoney(xpp));
6579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6580      res.getUdi().add(parseReference(xpp));
6581    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6582      return false;
6583    }
6584    return true;
6585  }
6586
6587  protected ClaimResponse parseClaimResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6588    ClaimResponse res = new ClaimResponse();
6589    parseResourceAttributes(xpp, res);
6590    next(xpp);
6591    int eventType = nextNoWhitespace(xpp);
6592    while (eventType != XmlPullParser.END_TAG) {
6593    if (!parseClaimResponseContent(eventType, xpp, res))
6594        unknownContent(xpp);
6595      eventType = nextNoWhitespace(xpp);
6596    }
6597    next(xpp);
6598    parseElementClose(res);
6599    return res;
6600  }
6601
6602  protected boolean parseClaimResponseContent(int eventType, XmlPullParser xpp, ClaimResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
6603    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6604      res.getIdentifier().add(parseIdentifier(xpp));
6605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6606      res.getTraceNumber().add(parseIdentifier(xpp));
6607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6608      res.setStatusElement(parseEnumeration(xpp, Enumerations.FinancialResourceStatusCodes.NULL, new Enumerations.FinancialResourceStatusCodesEnumFactory()));
6609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6610      res.setType(parseCodeableConcept(xpp));
6611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
6612      res.setSubType(parseCodeableConcept(xpp));
6613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
6614      res.setUseElement(parseEnumeration(xpp, Enumerations.Use.NULL, new Enumerations.UseEnumFactory()));
6615    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6616      res.setPatient(parseReference(xpp));
6617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6618      res.setCreatedElement(parseDateTime(xpp));
6619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
6620      res.setInsurer(parseReference(xpp));
6621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
6622      res.setRequestor(parseReference(xpp));
6623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
6624      res.setRequest(parseReference(xpp));
6625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
6626      res.setOutcomeElement(parseEnumeration(xpp, Enumerations.ClaimProcessingCodes.NULL, new Enumerations.ClaimProcessingCodesEnumFactory()));
6627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("decision")) {
6628      res.setDecision(parseCodeableConcept(xpp));
6629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
6630      res.setDispositionElement(parseString(xpp));
6631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
6632      res.setPreAuthRefElement(parseString(xpp));
6633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthPeriod")) {
6634      res.setPreAuthPeriod(parsePeriod(xpp));
6635    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
6636      res.getEvent().add(parseClaimResponseEventComponent(xpp));
6637    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payeeType")) {
6638      res.setPayeeType(parseCodeableConcept(xpp));
6639    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
6640      res.getEncounter().add(parseReference(xpp));
6641    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisRelatedGroup")) {
6642      res.setDiagnosisRelatedGroup(parseCodeableConcept(xpp));
6643    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
6644      res.getItem().add(parseClaimResponseItemComponent(xpp));
6645    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
6646      res.getAddItem().add(parseClaimResponseAddedItemComponent(xpp));
6647    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6648      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6649    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
6650      res.getTotal().add(parseClaimResponseTotalComponent(xpp));
6651    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
6652      res.setPayment(parseClaimResponsePaymentComponent(xpp));
6653    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
6654      res.setFundsReserve(parseCodeableConcept(xpp));
6655    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("formCode")) {
6656      res.setFormCode(parseCodeableConcept(xpp));
6657    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
6658      res.setForm(parseAttachment(xpp));
6659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
6660      res.getProcessNote().add(parseClaimResponseNoteComponent(xpp));
6661    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
6662      res.getCommunicationRequest().add(parseReference(xpp));
6663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
6664      res.getInsurance().add(parseClaimResponseInsuranceComponent(xpp));
6665    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
6666      res.getError().add(parseClaimResponseErrorComponent(xpp));
6667    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
6668      return false;
6669    }
6670    return true;
6671  }
6672
6673  protected ClaimResponse.ClaimResponseEventComponent parseClaimResponseEventComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6674    ClaimResponse.ClaimResponseEventComponent res = new ClaimResponse.ClaimResponseEventComponent();
6675    parseElementAttributes(xpp, res);
6676    next(xpp);
6677    int eventType = nextNoWhitespace(xpp);
6678    while (eventType != XmlPullParser.END_TAG) {
6679    if (!parseClaimResponseEventComponentContent(eventType, xpp, res))
6680        unknownContent(xpp);
6681      eventType = nextNoWhitespace(xpp);
6682    }
6683    next(xpp);
6684    parseElementClose(res);
6685    return res;
6686  }
6687
6688  protected boolean parseClaimResponseEventComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ClaimResponseEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6689    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6690      res.setType(parseCodeableConcept(xpp));
6691    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "when")) {
6692      res.setWhen(parseType("when", xpp));
6693    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6694      return false;
6695    }
6696    return true;
6697  }
6698
6699  protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6700    ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent();
6701    parseElementAttributes(xpp, res);
6702    next(xpp);
6703    int eventType = nextNoWhitespace(xpp);
6704    while (eventType != XmlPullParser.END_TAG) {
6705    if (!parseClaimResponseItemComponentContent(eventType, xpp, res))
6706        unknownContent(xpp);
6707      eventType = nextNoWhitespace(xpp);
6708    }
6709    next(xpp);
6710    parseElementClose(res);
6711    return res;
6712  }
6713
6714  protected boolean parseClaimResponseItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6715    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
6716      res.setItemSequenceElement(parsePositiveInt(xpp));
6717    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6718      res.getTraceNumber().add(parseIdentifier(xpp));
6719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6720      res.getNoteNumber().add(parsePositiveInt(xpp));
6721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
6722      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
6723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6724      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6726      res.getDetail().add(parseClaimResponseItemDetailComponent(xpp));
6727    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6728      return false;
6729    }
6730    return true;
6731  }
6732
6733  protected ClaimResponse.ReviewOutcomeComponent parseClaimResponseReviewOutcomeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6734    ClaimResponse.ReviewOutcomeComponent res = new ClaimResponse.ReviewOutcomeComponent();
6735    parseElementAttributes(xpp, res);
6736    next(xpp);
6737    int eventType = nextNoWhitespace(xpp);
6738    while (eventType != XmlPullParser.END_TAG) {
6739    if (!parseClaimResponseReviewOutcomeComponentContent(eventType, xpp, res))
6740        unknownContent(xpp);
6741      eventType = nextNoWhitespace(xpp);
6742    }
6743    next(xpp);
6744    parseElementClose(res);
6745    return res;
6746  }
6747
6748  protected boolean parseClaimResponseReviewOutcomeComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ReviewOutcomeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6749    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("decision")) {
6750      res.setDecision(parseCodeableConcept(xpp));
6751    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
6752      res.getReason().add(parseCodeableConcept(xpp));
6753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
6754      res.setPreAuthRefElement(parseString(xpp));
6755    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthPeriod")) {
6756      res.setPreAuthPeriod(parsePeriod(xpp));
6757    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6758      return false;
6759    }
6760    return true;
6761  }
6762
6763  protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6764    ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent();
6765    parseElementAttributes(xpp, res);
6766    next(xpp);
6767    int eventType = nextNoWhitespace(xpp);
6768    while (eventType != XmlPullParser.END_TAG) {
6769    if (!parseClaimResponseAdjudicationComponentContent(eventType, xpp, res))
6770        unknownContent(xpp);
6771      eventType = nextNoWhitespace(xpp);
6772    }
6773    next(xpp);
6774    parseElementClose(res);
6775    return res;
6776  }
6777
6778  protected boolean parseClaimResponseAdjudicationComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6779    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6780      res.setCategory(parseCodeableConcept(xpp));
6781    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
6782      res.setReason(parseCodeableConcept(xpp));
6783    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
6784      res.setAmount(parseMoney(xpp));
6785    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6786      res.setQuantity(parseQuantity(xpp));
6787    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6788      return false;
6789    }
6790    return true;
6791  }
6792
6793  protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6794    ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent();
6795    parseElementAttributes(xpp, res);
6796    next(xpp);
6797    int eventType = nextNoWhitespace(xpp);
6798    while (eventType != XmlPullParser.END_TAG) {
6799    if (!parseClaimResponseItemDetailComponentContent(eventType, xpp, res))
6800        unknownContent(xpp);
6801      eventType = nextNoWhitespace(xpp);
6802    }
6803    next(xpp);
6804    parseElementClose(res);
6805    return res;
6806  }
6807
6808  protected boolean parseClaimResponseItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6809    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
6810      res.setDetailSequenceElement(parsePositiveInt(xpp));
6811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6812      res.getTraceNumber().add(parseIdentifier(xpp));
6813    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6814      res.getNoteNumber().add(parsePositiveInt(xpp));
6815    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
6816      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
6817    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6818      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6819    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6820      res.getSubDetail().add(parseClaimResponseSubDetailComponent(xpp));
6821    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6822      return false;
6823    }
6824    return true;
6825  }
6826
6827  protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6828    ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent();
6829    parseElementAttributes(xpp, res);
6830    next(xpp);
6831    int eventType = nextNoWhitespace(xpp);
6832    while (eventType != XmlPullParser.END_TAG) {
6833    if (!parseClaimResponseSubDetailComponentContent(eventType, xpp, res))
6834        unknownContent(xpp);
6835      eventType = nextNoWhitespace(xpp);
6836    }
6837    next(xpp);
6838    parseElementClose(res);
6839    return res;
6840  }
6841
6842  protected boolean parseClaimResponseSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6843    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetailSequence")) {
6844      res.setSubDetailSequenceElement(parsePositiveInt(xpp));
6845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6846      res.getTraceNumber().add(parseIdentifier(xpp));
6847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6848      res.getNoteNumber().add(parsePositiveInt(xpp));
6849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
6850      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
6851    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6852      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6853    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6854      return false;
6855    }
6856    return true;
6857  }
6858
6859  protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6860    ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent();
6861    parseElementAttributes(xpp, res);
6862    next(xpp);
6863    int eventType = nextNoWhitespace(xpp);
6864    while (eventType != XmlPullParser.END_TAG) {
6865    if (!parseClaimResponseAddedItemComponentContent(eventType, xpp, res))
6866        unknownContent(xpp);
6867      eventType = nextNoWhitespace(xpp);
6868    }
6869    next(xpp);
6870    parseElementClose(res);
6871    return res;
6872  }
6873
6874  protected boolean parseClaimResponseAddedItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6875    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
6876      res.getItemSequence().add(parsePositiveInt(xpp));
6877    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
6878      res.getDetailSequence().add(parsePositiveInt(xpp));
6879    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subdetailSequence")) {
6880      res.getSubdetailSequence().add(parsePositiveInt(xpp));
6881    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6882      res.getTraceNumber().add(parseIdentifier(xpp));
6883    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
6884      res.getProvider().add(parseReference(xpp));
6885    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6886      res.setRevenue(parseCodeableConcept(xpp));
6887    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6888      res.setProductOrService(parseCodeableConcept(xpp));
6889    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
6890      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
6891    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
6892      res.getRequest().add(parseReference(xpp));
6893    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6894      res.getModifier().add(parseCodeableConcept(xpp));
6895    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
6896      res.getProgramCode().add(parseCodeableConcept(xpp));
6897    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
6898      res.setServiced(parseType("serviced", xpp));
6899    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
6900      res.setLocation(parseType("location", xpp));
6901    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6902      res.setQuantity(parseQuantity(xpp));
6903    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6904      res.setUnitPrice(parseMoney(xpp));
6905    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6906      res.setFactorElement(parseDecimal(xpp));
6907    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tax")) {
6908      res.setTax(parseMoney(xpp));
6909    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6910      res.setNet(parseMoney(xpp));
6911    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6912      res.getBodySite().add(parseClaimResponseBodySiteComponent(xpp));
6913    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6914      res.getNoteNumber().add(parsePositiveInt(xpp));
6915    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
6916      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
6917    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6918      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6919    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6920      res.getDetail().add(parseClaimResponseAddedItemDetailComponent(xpp));
6921    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6922      return false;
6923    }
6924    return true;
6925  }
6926
6927  protected ClaimResponse.BodySiteComponent parseClaimResponseBodySiteComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6928    ClaimResponse.BodySiteComponent res = new ClaimResponse.BodySiteComponent();
6929    parseElementAttributes(xpp, res);
6930    next(xpp);
6931    int eventType = nextNoWhitespace(xpp);
6932    while (eventType != XmlPullParser.END_TAG) {
6933    if (!parseClaimResponseBodySiteComponentContent(eventType, xpp, res))
6934        unknownContent(xpp);
6935      eventType = nextNoWhitespace(xpp);
6936    }
6937    next(xpp);
6938    parseElementClose(res);
6939    return res;
6940  }
6941
6942  protected boolean parseClaimResponseBodySiteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.BodySiteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6943    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
6944      res.getSite().add(parseCodeableReference(xpp));
6945    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
6946      res.getSubSite().add(parseCodeableConcept(xpp));
6947    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6948      return false;
6949    }
6950    return true;
6951  }
6952
6953  protected ClaimResponse.AddedItemDetailComponent parseClaimResponseAddedItemDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6954    ClaimResponse.AddedItemDetailComponent res = new ClaimResponse.AddedItemDetailComponent();
6955    parseElementAttributes(xpp, res);
6956    next(xpp);
6957    int eventType = nextNoWhitespace(xpp);
6958    while (eventType != XmlPullParser.END_TAG) {
6959    if (!parseClaimResponseAddedItemDetailComponentContent(eventType, xpp, res))
6960        unknownContent(xpp);
6961      eventType = nextNoWhitespace(xpp);
6962    }
6963    next(xpp);
6964    parseElementClose(res);
6965    return res;
6966  }
6967
6968  protected boolean parseClaimResponseAddedItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6969    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
6970      res.getTraceNumber().add(parseIdentifier(xpp));
6971    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
6972      res.setRevenue(parseCodeableConcept(xpp));
6973    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
6974      res.setProductOrService(parseCodeableConcept(xpp));
6975    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
6976      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
6977    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
6978      res.getModifier().add(parseCodeableConcept(xpp));
6979    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6980      res.setQuantity(parseQuantity(xpp));
6981    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6982      res.setUnitPrice(parseMoney(xpp));
6983    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6984      res.setFactorElement(parseDecimal(xpp));
6985    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tax")) {
6986      res.setTax(parseMoney(xpp));
6987    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6988      res.setNet(parseMoney(xpp));
6989    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
6990      res.getNoteNumber().add(parsePositiveInt(xpp));
6991    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
6992      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
6993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
6994      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
6995    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
6996      res.getSubDetail().add(parseClaimResponseAddedItemSubDetailComponent(xpp));
6997    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
6998      return false;
6999    }
7000    return true;
7001  }
7002
7003  protected ClaimResponse.AddedItemSubDetailComponent parseClaimResponseAddedItemSubDetailComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7004    ClaimResponse.AddedItemSubDetailComponent res = new ClaimResponse.AddedItemSubDetailComponent();
7005    parseElementAttributes(xpp, res);
7006    next(xpp);
7007    int eventType = nextNoWhitespace(xpp);
7008    while (eventType != XmlPullParser.END_TAG) {
7009    if (!parseClaimResponseAddedItemSubDetailComponentContent(eventType, xpp, res))
7010        unknownContent(xpp);
7011      eventType = nextNoWhitespace(xpp);
7012    }
7013    next(xpp);
7014    parseElementClose(res);
7015    return res;
7016  }
7017
7018  protected boolean parseClaimResponseAddedItemSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.AddedItemSubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7019    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("traceNumber")) {
7020      res.getTraceNumber().add(parseIdentifier(xpp));
7021    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
7022      res.setRevenue(parseCodeableConcept(xpp));
7023    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrService")) {
7024      res.setProductOrService(parseCodeableConcept(xpp));
7025    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productOrServiceEnd")) {
7026      res.setProductOrServiceEnd(parseCodeableConcept(xpp));
7027    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
7028      res.getModifier().add(parseCodeableConcept(xpp));
7029    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
7030      res.setQuantity(parseQuantity(xpp));
7031    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
7032      res.setUnitPrice(parseMoney(xpp));
7033    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
7034      res.setFactorElement(parseDecimal(xpp));
7035    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tax")) {
7036      res.setTax(parseMoney(xpp));
7037    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
7038      res.setNet(parseMoney(xpp));
7039    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
7040      res.getNoteNumber().add(parsePositiveInt(xpp));
7041    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewOutcome")) {
7042      res.setReviewOutcome(parseClaimResponseReviewOutcomeComponent(xpp));
7043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
7044      res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp));
7045    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7046      return false;
7047    }
7048    return true;
7049  }
7050
7051  protected ClaimResponse.TotalComponent parseClaimResponseTotalComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7052    ClaimResponse.TotalComponent res = new ClaimResponse.TotalComponent();
7053    parseElementAttributes(xpp, res);
7054    next(xpp);
7055    int eventType = nextNoWhitespace(xpp);
7056    while (eventType != XmlPullParser.END_TAG) {
7057    if (!parseClaimResponseTotalComponentContent(eventType, xpp, res))
7058        unknownContent(xpp);
7059      eventType = nextNoWhitespace(xpp);
7060    }
7061    next(xpp);
7062    parseElementClose(res);
7063    return res;
7064  }
7065
7066  protected boolean parseClaimResponseTotalComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.TotalComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7067    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7068      res.setCategory(parseCodeableConcept(xpp));
7069    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
7070      res.setAmount(parseMoney(xpp));
7071    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7072      return false;
7073    }
7074    return true;
7075  }
7076
7077  protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7078    ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent();
7079    parseElementAttributes(xpp, res);
7080    next(xpp);
7081    int eventType = nextNoWhitespace(xpp);
7082    while (eventType != XmlPullParser.END_TAG) {
7083    if (!parseClaimResponsePaymentComponentContent(eventType, xpp, res))
7084        unknownContent(xpp);
7085      eventType = nextNoWhitespace(xpp);
7086    }
7087    next(xpp);
7088    parseElementClose(res);
7089    return res;
7090  }
7091
7092  protected boolean parseClaimResponsePaymentComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7093    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7094      res.setType(parseCodeableConcept(xpp));
7095    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
7096      res.setAdjustment(parseMoney(xpp));
7097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
7098      res.setAdjustmentReason(parseCodeableConcept(xpp));
7099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7100      res.setDateElement(parseDate(xpp));
7101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
7102      res.setAmount(parseMoney(xpp));
7103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7104      res.setIdentifier(parseIdentifier(xpp));
7105    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7106      return false;
7107    }
7108    return true;
7109  }
7110
7111  protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7112    ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent();
7113    parseElementAttributes(xpp, res);
7114    next(xpp);
7115    int eventType = nextNoWhitespace(xpp);
7116    while (eventType != XmlPullParser.END_TAG) {
7117    if (!parseClaimResponseNoteComponentContent(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 parseClaimResponseNoteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7127    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
7128      res.setNumberElement(parsePositiveInt(xpp));
7129    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7130      res.setType(parseCodeableConcept(xpp));
7131    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
7132      res.setTextElement(parseString(xpp));
7133    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7134      res.setLanguage(parseCodeableConcept(xpp));
7135    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7136      return false;
7137    }
7138    return true;
7139  }
7140
7141  protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7142    ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent();
7143    parseElementAttributes(xpp, res);
7144    next(xpp);
7145    int eventType = nextNoWhitespace(xpp);
7146    while (eventType != XmlPullParser.END_TAG) {
7147    if (!parseClaimResponseInsuranceComponentContent(eventType, xpp, res))
7148        unknownContent(xpp);
7149      eventType = nextNoWhitespace(xpp);
7150    }
7151    next(xpp);
7152    parseElementClose(res);
7153    return res;
7154  }
7155
7156  protected boolean parseClaimResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7157    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
7158      res.setSequenceElement(parsePositiveInt(xpp));
7159    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
7160      res.setFocalElement(parseBoolean(xpp));
7161    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7162      res.setCoverage(parseReference(xpp));
7163    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
7164      res.setBusinessArrangementElement(parseString(xpp));
7165    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
7166      res.setClaimResponse(parseReference(xpp));
7167    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7168      return false;
7169    }
7170    return true;
7171  }
7172
7173  protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7174    ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent();
7175    parseElementAttributes(xpp, res);
7176    next(xpp);
7177    int eventType = nextNoWhitespace(xpp);
7178    while (eventType != XmlPullParser.END_TAG) {
7179    if (!parseClaimResponseErrorComponentContent(eventType, xpp, res))
7180        unknownContent(xpp);
7181      eventType = nextNoWhitespace(xpp);
7182    }
7183    next(xpp);
7184    parseElementClose(res);
7185    return res;
7186  }
7187
7188  protected boolean parseClaimResponseErrorComponentContent(int eventType, XmlPullParser xpp, ClaimResponse.ErrorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7189    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("itemSequence")) {
7190      res.setItemSequenceElement(parsePositiveInt(xpp));
7191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequence")) {
7192      res.setDetailSequenceElement(parsePositiveInt(xpp));
7193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetailSequence")) {
7194      res.setSubDetailSequenceElement(parsePositiveInt(xpp));
7195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7196      res.setCode(parseCodeableConcept(xpp));
7197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
7198      res.getExpression().add(parseString(xpp));
7199    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7200      return false;
7201    }
7202    return true;
7203  }
7204
7205  protected ClinicalImpression parseClinicalImpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7206    ClinicalImpression res = new ClinicalImpression();
7207    parseResourceAttributes(xpp, res);
7208    next(xpp);
7209    int eventType = nextNoWhitespace(xpp);
7210    while (eventType != XmlPullParser.END_TAG) {
7211    if (!parseClinicalImpressionContent(eventType, xpp, res))
7212        unknownContent(xpp);
7213      eventType = nextNoWhitespace(xpp);
7214    }
7215    next(xpp);
7216    parseElementClose(res);
7217    return res;
7218  }
7219
7220  protected boolean parseClinicalImpressionContent(int eventType, XmlPullParser xpp, ClinicalImpression res) throws XmlPullParserException, IOException, FHIRFormatError {
7221    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7222      res.getIdentifier().add(parseIdentifier(xpp));
7223    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7224      res.setStatusElement(parseEnumeration(xpp, Enumerations.EventStatus.NULL, new Enumerations.EventStatusEnumFactory()));
7225    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
7226      res.setStatusReason(parseCodeableConcept(xpp));
7227    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7228      res.setDescriptionElement(parseString(xpp));
7229    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7230      res.setSubject(parseReference(xpp));
7231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7232      res.setEncounter(parseReference(xpp));
7233    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
7234      res.setEffective(parseType("effective", xpp));
7235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7236      res.setDateElement(parseDateTime(xpp));
7237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
7238      res.setPerformer(parseReference(xpp));
7239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previous")) {
7240      res.setPrevious(parseReference(xpp));
7241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("problem")) {
7242      res.getProblem().add(parseReference(xpp));
7243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("changePattern")) {
7244      res.setChangePattern(parseCodeableConcept(xpp));
7245    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
7246      res.getProtocol().add(parseUri(xpp));
7247    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
7248      res.setSummaryElement(parseString(xpp));
7249    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("finding")) {
7250      res.getFinding().add(parseClinicalImpressionFindingComponent(xpp));
7251    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisCodeableConcept")) {
7252      res.getPrognosisCodeableConcept().add(parseCodeableConcept(xpp));
7253    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisReference")) {
7254      res.getPrognosisReference().add(parseReference(xpp));
7255    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
7256      res.getSupportingInfo().add(parseReference(xpp));
7257    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
7258      res.getNote().add(parseAnnotation(xpp));
7259    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7260      return false;
7261    }
7262    return true;
7263  }
7264
7265  protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionFindingComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7266    ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent();
7267    parseElementAttributes(xpp, res);
7268    next(xpp);
7269    int eventType = nextNoWhitespace(xpp);
7270    while (eventType != XmlPullParser.END_TAG) {
7271    if (!parseClinicalImpressionFindingComponentContent(eventType, xpp, res))
7272        unknownContent(xpp);
7273      eventType = nextNoWhitespace(xpp);
7274    }
7275    next(xpp);
7276    parseElementClose(res);
7277    return res;
7278  }
7279
7280  protected boolean parseClinicalImpressionFindingComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression.ClinicalImpressionFindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7281    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
7282      res.setItem(parseCodeableReference(xpp));
7283    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
7284      res.setBasisElement(parseString(xpp));
7285    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7286      return false;
7287    }
7288    return true;
7289  }
7290
7291  protected ClinicalUseDefinition parseClinicalUseDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7292    ClinicalUseDefinition res = new ClinicalUseDefinition();
7293    parseResourceAttributes(xpp, res);
7294    next(xpp);
7295    int eventType = nextNoWhitespace(xpp);
7296    while (eventType != XmlPullParser.END_TAG) {
7297    if (!parseClinicalUseDefinitionContent(eventType, xpp, res))
7298        unknownContent(xpp);
7299      eventType = nextNoWhitespace(xpp);
7300    }
7301    next(xpp);
7302    parseElementClose(res);
7303    return res;
7304  }
7305
7306  protected boolean parseClinicalUseDefinitionContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
7307    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7308      res.getIdentifier().add(parseIdentifier(xpp));
7309    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7310      res.setTypeElement(parseEnumeration(xpp, ClinicalUseDefinition.ClinicalUseDefinitionType.NULL, new ClinicalUseDefinition.ClinicalUseDefinitionTypeEnumFactory()));
7311    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7312      res.getCategory().add(parseCodeableConcept(xpp));
7313    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7314      res.getSubject().add(parseReference(xpp));
7315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7316      res.setStatus(parseCodeableConcept(xpp));
7317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contraindication")) {
7318      res.setContraindication(parseClinicalUseDefinitionContraindicationComponent(xpp));
7319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
7320      res.setIndication(parseClinicalUseDefinitionIndicationComponent(xpp));
7321    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
7322      res.setInteraction(parseClinicalUseDefinitionInteractionComponent(xpp));
7323    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("population")) {
7324      res.getPopulation().add(parseReference(xpp));
7325    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
7326      res.getLibrary().add(parseCanonical(xpp));
7327    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
7328      res.setUndesirableEffect(parseClinicalUseDefinitionUndesirableEffectComponent(xpp));
7329    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("warning")) {
7330      res.setWarning(parseClinicalUseDefinitionWarningComponent(xpp));
7331    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7332      return false;
7333    }
7334    return true;
7335  }
7336
7337  protected ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent parseClinicalUseDefinitionContraindicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7338    ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent();
7339    parseElementAttributes(xpp, res);
7340    next(xpp);
7341    int eventType = nextNoWhitespace(xpp);
7342    while (eventType != XmlPullParser.END_TAG) {
7343    if (!parseClinicalUseDefinitionContraindicationComponentContent(eventType, xpp, res))
7344        unknownContent(xpp);
7345      eventType = nextNoWhitespace(xpp);
7346    }
7347    next(xpp);
7348    parseElementClose(res);
7349    return res;
7350  }
7351
7352  protected boolean parseClinicalUseDefinitionContraindicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7353    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
7354      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
7355    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
7356      res.setDiseaseStatus(parseCodeableReference(xpp));
7357    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
7358      res.getComorbidity().add(parseCodeableReference(xpp));
7359    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
7360      res.getIndication().add(parseReference(xpp));
7361    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
7362      res.setApplicability(parseExpression(xpp));
7363    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
7364      res.getOtherTherapy().add(parseClinicalUseDefinitionContraindicationOtherTherapyComponent(xpp));
7365    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7366      return false;
7367    }
7368    return true;
7369  }
7370
7371  protected ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent parseClinicalUseDefinitionContraindicationOtherTherapyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7372    ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent();
7373    parseElementAttributes(xpp, res);
7374    next(xpp);
7375    int eventType = nextNoWhitespace(xpp);
7376    while (eventType != XmlPullParser.END_TAG) {
7377    if (!parseClinicalUseDefinitionContraindicationOtherTherapyComponentContent(eventType, xpp, res))
7378        unknownContent(xpp);
7379      eventType = nextNoWhitespace(xpp);
7380    }
7381    next(xpp);
7382    parseElementClose(res);
7383    return res;
7384  }
7385
7386  protected boolean parseClinicalUseDefinitionContraindicationOtherTherapyComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionContraindicationOtherTherapyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7387    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationshipType")) {
7388      res.setRelationshipType(parseCodeableConcept(xpp));
7389    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("treatment")) {
7390      res.setTreatment(parseCodeableReference(xpp));
7391    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7392      return false;
7393    }
7394    return true;
7395  }
7396
7397  protected ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent parseClinicalUseDefinitionIndicationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7398    ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent();
7399    parseElementAttributes(xpp, res);
7400    next(xpp);
7401    int eventType = nextNoWhitespace(xpp);
7402    while (eventType != XmlPullParser.END_TAG) {
7403    if (!parseClinicalUseDefinitionIndicationComponentContent(eventType, xpp, res))
7404        unknownContent(xpp);
7405      eventType = nextNoWhitespace(xpp);
7406    }
7407    next(xpp);
7408    parseElementClose(res);
7409    return res;
7410  }
7411
7412  protected boolean parseClinicalUseDefinitionIndicationComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionIndicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7413    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseSymptomProcedure")) {
7414      res.setDiseaseSymptomProcedure(parseCodeableReference(xpp));
7415    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diseaseStatus")) {
7416      res.setDiseaseStatus(parseCodeableReference(xpp));
7417    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comorbidity")) {
7418      res.getComorbidity().add(parseCodeableReference(xpp));
7419    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intendedEffect")) {
7420      res.setIntendedEffect(parseCodeableReference(xpp));
7421    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "duration")) {
7422      res.setDuration(parseType("duration", xpp));
7423    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("undesirableEffect")) {
7424      res.getUndesirableEffect().add(parseReference(xpp));
7425    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applicability")) {
7426      res.setApplicability(parseExpression(xpp));
7427    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("otherTherapy")) {
7428      res.getOtherTherapy().add(parseClinicalUseDefinitionContraindicationOtherTherapyComponent(xpp));
7429    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7430      return false;
7431    }
7432    return true;
7433  }
7434
7435  protected ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent parseClinicalUseDefinitionInteractionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7436    ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent();
7437    parseElementAttributes(xpp, res);
7438    next(xpp);
7439    int eventType = nextNoWhitespace(xpp);
7440    while (eventType != XmlPullParser.END_TAG) {
7441    if (!parseClinicalUseDefinitionInteractionComponentContent(eventType, xpp, res))
7442        unknownContent(xpp);
7443      eventType = nextNoWhitespace(xpp);
7444    }
7445    next(xpp);
7446    parseElementClose(res);
7447    return res;
7448  }
7449
7450  protected boolean parseClinicalUseDefinitionInteractionComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7451    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interactant")) {
7452      res.getInteractant().add(parseClinicalUseDefinitionInteractionInteractantComponent(xpp));
7453    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7454      res.setType(parseCodeableConcept(xpp));
7455    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effect")) {
7456      res.setEffect(parseCodeableReference(xpp));
7457    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incidence")) {
7458      res.setIncidence(parseCodeableConcept(xpp));
7459    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("management")) {
7460      res.getManagement().add(parseCodeableConcept(xpp));
7461    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7462      return false;
7463    }
7464    return true;
7465  }
7466
7467  protected ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent parseClinicalUseDefinitionInteractionInteractantComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7468    ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent();
7469    parseElementAttributes(xpp, res);
7470    next(xpp);
7471    int eventType = nextNoWhitespace(xpp);
7472    while (eventType != XmlPullParser.END_TAG) {
7473    if (!parseClinicalUseDefinitionInteractionInteractantComponentContent(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 parseClinicalUseDefinitionInteractionInteractantComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionInteractionInteractantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7483    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
7484      res.setItem(parseType("item", xpp));
7485    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7486      return false;
7487    }
7488    return true;
7489  }
7490
7491  protected ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent parseClinicalUseDefinitionUndesirableEffectComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7492    ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent();
7493    parseElementAttributes(xpp, res);
7494    next(xpp);
7495    int eventType = nextNoWhitespace(xpp);
7496    while (eventType != XmlPullParser.END_TAG) {
7497    if (!parseClinicalUseDefinitionUndesirableEffectComponentContent(eventType, xpp, res))
7498        unknownContent(xpp);
7499      eventType = nextNoWhitespace(xpp);
7500    }
7501    next(xpp);
7502    parseElementClose(res);
7503    return res;
7504  }
7505
7506  protected boolean parseClinicalUseDefinitionUndesirableEffectComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionUndesirableEffectComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7507    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("symptomConditionEffect")) {
7508      res.setSymptomConditionEffect(parseCodeableReference(xpp));
7509    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classification")) {
7510      res.setClassification(parseCodeableConcept(xpp));
7511    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyOfOccurrence")) {
7512      res.setFrequencyOfOccurrence(parseCodeableConcept(xpp));
7513    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7514      return false;
7515    }
7516    return true;
7517  }
7518
7519  protected ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent parseClinicalUseDefinitionWarningComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7520    ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent res = new ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent();
7521    parseElementAttributes(xpp, res);
7522    next(xpp);
7523    int eventType = nextNoWhitespace(xpp);
7524    while (eventType != XmlPullParser.END_TAG) {
7525    if (!parseClinicalUseDefinitionWarningComponentContent(eventType, xpp, res))
7526        unknownContent(xpp);
7527      eventType = nextNoWhitespace(xpp);
7528    }
7529    next(xpp);
7530    parseElementClose(res);
7531    return res;
7532  }
7533
7534  protected boolean parseClinicalUseDefinitionWarningComponentContent(int eventType, XmlPullParser xpp, ClinicalUseDefinition.ClinicalUseDefinitionWarningComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7535    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7536      res.setDescriptionElement(parseMarkdown(xpp));
7537    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7538      res.setCode(parseCodeableConcept(xpp));
7539    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7540      return false;
7541    }
7542    return true;
7543  }
7544
7545  protected CodeSystem parseCodeSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7546    CodeSystem res = new CodeSystem();
7547    parseResourceAttributes(xpp, res);
7548    next(xpp);
7549    int eventType = nextNoWhitespace(xpp);
7550    while (eventType != XmlPullParser.END_TAG) {
7551    if (!parseCodeSystemContent(eventType, xpp, res))
7552        unknownContent(xpp);
7553      eventType = nextNoWhitespace(xpp);
7554    }
7555    next(xpp);
7556    parseElementClose(res);
7557    return res;
7558  }
7559
7560  protected boolean parseCodeSystemContent(int eventType, XmlPullParser xpp, CodeSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
7561    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7562      res.setUrlElement(parseUri(xpp));
7563    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7564      res.getIdentifier().add(parseIdentifier(xpp));
7565    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7566      res.setVersionElement(parseString(xpp));
7567    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
7568      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
7569    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7570      res.setNameElement(parseString(xpp));
7571    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7572      res.setTitleElement(parseString(xpp));
7573    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7574      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7575    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7576      res.setExperimentalElement(parseBoolean(xpp));
7577    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7578      res.setDateElement(parseDateTime(xpp));
7579    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7580      res.setPublisherElement(parseString(xpp));
7581    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7582      res.getContact().add(parseContactDetail(xpp));
7583    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7584      res.setDescriptionElement(parseMarkdown(xpp));
7585    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7586      res.getUseContext().add(parseUsageContext(xpp));
7587    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
7588      res.getJurisdiction().add(parseCodeableConcept(xpp));
7589    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
7590      res.setPurposeElement(parseMarkdown(xpp));
7591    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
7592      res.setCopyrightElement(parseMarkdown(xpp));
7593    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
7594      res.setCopyrightLabelElement(parseString(xpp));
7595    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
7596      res.setApprovalDateElement(parseDate(xpp));
7597    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
7598      res.setLastReviewDateElement(parseDate(xpp));
7599    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
7600      res.setEffectivePeriod(parsePeriod(xpp));
7601    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
7602      res.getTopic().add(parseCodeableConcept(xpp));
7603    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
7604      res.getAuthor().add(parseContactDetail(xpp));
7605    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
7606      res.getEditor().add(parseContactDetail(xpp));
7607    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
7608      res.getReviewer().add(parseContactDetail(xpp));
7609    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
7610      res.getEndorser().add(parseContactDetail(xpp));
7611    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
7612      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
7613    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caseSensitive")) {
7614      res.setCaseSensitiveElement(parseBoolean(xpp));
7615    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
7616      res.setValueSetElement(parseCanonical(xpp));
7617    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hierarchyMeaning")) {
7618      res.setHierarchyMeaningElement(parseEnumeration(xpp, CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()));
7619    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositional")) {
7620      res.setCompositionalElement(parseBoolean(xpp));
7621    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionNeeded")) {
7622      res.setVersionNeededElement(parseBoolean(xpp));
7623    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
7624      res.setContentElement(parseEnumeration(xpp, Enumerations.CodeSystemContentMode.NULL, new Enumerations.CodeSystemContentModeEnumFactory()));
7625    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supplements")) {
7626      res.setSupplementsElement(parseCanonical(xpp));
7627    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
7628      res.setCountElement(parseUnsignedInt(xpp));
7629    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
7630      res.getFilter().add(parseCodeSystemFilterComponent(xpp));
7631    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
7632      res.getProperty().add(parseCodeSystemPropertyComponent(xpp));
7633    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
7634      res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp));
7635    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
7636      return false;
7637    }
7638    return true;
7639  }
7640
7641  protected CodeSystem.CodeSystemFilterComponent parseCodeSystemFilterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7642    CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent();
7643    parseElementAttributes(xpp, res);
7644    next(xpp);
7645    int eventType = nextNoWhitespace(xpp);
7646    while (eventType != XmlPullParser.END_TAG) {
7647    if (!parseCodeSystemFilterComponentContent(eventType, xpp, res))
7648        unknownContent(xpp);
7649      eventType = nextNoWhitespace(xpp);
7650    }
7651    next(xpp);
7652    parseElementClose(res);
7653    return res;
7654  }
7655
7656  protected boolean parseCodeSystemFilterComponentContent(int eventType, XmlPullParser xpp, CodeSystem.CodeSystemFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7657    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7658      res.setCodeElement(parseCode(xpp));
7659    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7660      res.setDescriptionElement(parseString(xpp));
7661    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
7662      res.getOperator().add(parseEnumeration(xpp, Enumerations.FilterOperator.NULL, new Enumerations.FilterOperatorEnumFactory()));
7663    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
7664      res.setValueElement(parseString(xpp));
7665    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7666      return false;
7667    }
7668    return true;
7669  }
7670
7671  protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7672    CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent();
7673    parseElementAttributes(xpp, res);
7674    next(xpp);
7675    int eventType = nextNoWhitespace(xpp);
7676    while (eventType != XmlPullParser.END_TAG) {
7677    if (!parseCodeSystemPropertyComponentContent(eventType, xpp, res))
7678        unknownContent(xpp);
7679      eventType = nextNoWhitespace(xpp);
7680    }
7681    next(xpp);
7682    parseElementClose(res);
7683    return res;
7684  }
7685
7686  protected boolean parseCodeSystemPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem.PropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7687    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7688      res.setCodeElement(parseCode(xpp));
7689    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
7690      res.setUriElement(parseUri(xpp));
7691    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7692      res.setDescriptionElement(parseString(xpp));
7693    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7694      res.setTypeElement(parseEnumeration(xpp, CodeSystem.PropertyType.NULL, new CodeSystem.PropertyTypeEnumFactory()));
7695    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7696      return false;
7697    }
7698    return true;
7699  }
7700
7701  protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7702    CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent();
7703    parseElementAttributes(xpp, res);
7704    next(xpp);
7705    int eventType = nextNoWhitespace(xpp);
7706    while (eventType != XmlPullParser.END_TAG) {
7707    if (!parseCodeSystemConceptDefinitionComponentContent(eventType, xpp, res))
7708        unknownContent(xpp);
7709      eventType = nextNoWhitespace(xpp);
7710    }
7711    next(xpp);
7712    parseElementClose(res);
7713    return res;
7714  }
7715
7716  protected boolean parseCodeSystemConceptDefinitionComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptDefinitionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7717    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7718      res.setCodeElement(parseCode(xpp));
7719    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
7720      res.setDisplayElement(parseString(xpp));
7721    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
7722      res.setDefinitionElement(parseString(xpp));
7723    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7724      res.getDesignation().add(parseCodeSystemConceptDefinitionDesignationComponent(xpp));
7725    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
7726      res.getProperty().add(parseCodeSystemConceptPropertyComponent(xpp));
7727    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
7728      res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp));
7729    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7730      return false;
7731    }
7732    return true;
7733  }
7734
7735  protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7736    CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent();
7737    parseElementAttributes(xpp, res);
7738    next(xpp);
7739    int eventType = nextNoWhitespace(xpp);
7740    while (eventType != XmlPullParser.END_TAG) {
7741    if (!parseCodeSystemConceptDefinitionDesignationComponentContent(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 parseCodeSystemConceptDefinitionDesignationComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptDefinitionDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7751    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7752      res.setLanguageElement(parseCode(xpp));
7753    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7754      res.setUse(parseCoding(xpp));
7755    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalUse")) {
7756      res.getAdditionalUse().add(parseCoding(xpp));
7757    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
7758      res.setValueElement(parseString(xpp));
7759    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7760      return false;
7761    }
7762    return true;
7763  }
7764
7765  protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7766    CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent();
7767    parseElementAttributes(xpp, res);
7768    next(xpp);
7769    int eventType = nextNoWhitespace(xpp);
7770    while (eventType != XmlPullParser.END_TAG) {
7771    if (!parseCodeSystemConceptPropertyComponentContent(eventType, xpp, res))
7772        unknownContent(xpp);
7773      eventType = nextNoWhitespace(xpp);
7774    }
7775    next(xpp);
7776    parseElementClose(res);
7777    return res;
7778  }
7779
7780  protected boolean parseCodeSystemConceptPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem.ConceptPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7781    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7782      res.setCodeElement(parseCode(xpp));
7783    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
7784      res.setValue(parseType("value", xpp));
7785    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7786      return false;
7787    }
7788    return true;
7789  }
7790
7791  protected Communication parseCommunication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7792    Communication res = new Communication();
7793    parseResourceAttributes(xpp, res);
7794    next(xpp);
7795    int eventType = nextNoWhitespace(xpp);
7796    while (eventType != XmlPullParser.END_TAG) {
7797    if (!parseCommunicationContent(eventType, xpp, res))
7798        unknownContent(xpp);
7799      eventType = nextNoWhitespace(xpp);
7800    }
7801    next(xpp);
7802    parseElementClose(res);
7803    return res;
7804  }
7805
7806  protected boolean parseCommunicationContent(int eventType, XmlPullParser xpp, Communication res) throws XmlPullParserException, IOException, FHIRFormatError {
7807    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7808      res.getIdentifier().add(parseIdentifier(xpp));
7809    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesCanonical")) {
7810      res.getInstantiatesCanonical().add(parseCanonical(xpp));
7811    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiatesUri")) {
7812      res.getInstantiatesUri().add(parseUri(xpp));
7813    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
7814      res.getBasedOn().add(parseReference(xpp));
7815    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
7816      res.getPartOf().add(parseReference(xpp));
7817    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inResponseTo")) {
7818      res.getInResponseTo().add(parseReference(xpp));
7819    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7820      res.setStatusElement(parseEnumeration(xpp, Enumerations.EventStatus.NULL, new Enumerations.EventStatusEnumFactory()));
7821    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
7822      res.setStatusReason(parseCodeableConcept(xpp));
7823    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7824      res.getCategory().add(parseCodeableConcept(xpp));
7825    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7826      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
7827    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
7828      res.getMedium().add(parseCodeableConcept(xpp));
7829    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7830      res.setSubject(parseReference(xpp));
7831    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
7832      res.setTopic(parseCodeableConcept(xpp));
7833    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("about")) {
7834      res.getAbout().add(parseReference(xpp));
7835    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7836      res.setEncounter(parseReference(xpp));
7837    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sent")) {
7838      res.setSentElement(parseDateTime(xpp));
7839    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("received")) {
7840      res.setReceivedElement(parseDateTime(xpp));
7841    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
7842      res.getRecipient().add(parseReference(xpp));
7843    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
7844      res.setSender(parseReference(xpp));
7845    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7846      res.getReason().add(parseCodeableReference(xpp));
7847    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
7848      res.getPayload().add(parseCommunicationPayloadComponent(xpp));
7849    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
7850      res.getNote().add(parseAnnotation(xpp));
7851    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7852      return false;
7853    }
7854    return true;
7855  }
7856
7857  protected Communication.CommunicationPayloadComponent parseCommunicationPayloadComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7858    Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent();
7859    parseElementAttributes(xpp, res);
7860    next(xpp);
7861    int eventType = nextNoWhitespace(xpp);
7862    while (eventType != XmlPullParser.END_TAG) {
7863    if (!parseCommunicationPayloadComponentContent(eventType, xpp, res))
7864        unknownContent(xpp);
7865      eventType = nextNoWhitespace(xpp);
7866    }
7867    next(xpp);
7868    parseElementClose(res);
7869    return res;
7870  }
7871
7872  protected boolean parseCommunicationPayloadComponentContent(int eventType, XmlPullParser xpp, Communication.CommunicationPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7873    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
7874      res.setContent(parseType("content", xpp));
7875    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7876      return false;
7877    }
7878    return true;
7879  }
7880
7881  protected CommunicationRequest parseCommunicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7882    CommunicationRequest res = new CommunicationRequest();
7883    parseResourceAttributes(xpp, res);
7884    next(xpp);
7885    int eventType = nextNoWhitespace(xpp);
7886    while (eventType != XmlPullParser.END_TAG) {
7887    if (!parseCommunicationRequestContent(eventType, xpp, res))
7888        unknownContent(xpp);
7889      eventType = nextNoWhitespace(xpp);
7890    }
7891    next(xpp);
7892    parseElementClose(res);
7893    return res;
7894  }
7895
7896  protected boolean parseCommunicationRequestContent(int eventType, XmlPullParser xpp, CommunicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7897    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7898      res.getIdentifier().add(parseIdentifier(xpp));
7899    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
7900      res.getBasedOn().add(parseReference(xpp));
7901    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
7902      res.getReplaces().add(parseReference(xpp));
7903    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
7904      res.setGroupIdentifier(parseIdentifier(xpp));
7905    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7906      res.setStatusElement(parseEnumeration(xpp, Enumerations.RequestStatus.NULL, new Enumerations.RequestStatusEnumFactory()));
7907    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
7908      res.setStatusReason(parseCodeableConcept(xpp));
7909    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
7910      res.setIntentElement(parseEnumeration(xpp, Enumerations.RequestIntent.NULL, new Enumerations.RequestIntentEnumFactory()));
7911    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7912      res.getCategory().add(parseCodeableConcept(xpp));
7913    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7914      res.setPriorityElement(parseEnumeration(xpp, Enumerations.RequestPriority.NULL, new Enumerations.RequestPriorityEnumFactory()));
7915    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("doNotPerform")) {
7916      res.setDoNotPerformElement(parseBoolean(xpp));
7917    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
7918      res.getMedium().add(parseCodeableConcept(xpp));
7919    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7920      res.setSubject(parseReference(xpp));
7921    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("about")) {
7922      res.getAbout().add(parseReference(xpp));
7923    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7924      res.setEncounter(parseReference(xpp));
7925    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
7926      res.getPayload().add(parseCommunicationRequestPayloadComponent(xpp));
7927    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
7928      res.setOccurrence(parseType("occurrence", xpp));
7929    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
7930      res.setAuthoredOnElement(parseDateTime(xpp));
7931    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
7932      res.setRequester(parseReference(xpp));
7933    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
7934      res.getRecipient().add(parseReference(xpp));
7935    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationProvider")) {
7936      res.getInformationProvider().add(parseReference(xpp));
7937    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7938      res.getReason().add(parseCodeableReference(xpp));
7939    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
7940      res.getNote().add(parseAnnotation(xpp));
7941    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
7942      return false;
7943    }
7944    return true;
7945  }
7946
7947  protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestPayloadComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7948    CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent();
7949    parseElementAttributes(xpp, res);
7950    next(xpp);
7951    int eventType = nextNoWhitespace(xpp);
7952    while (eventType != XmlPullParser.END_TAG) {
7953    if (!parseCommunicationRequestPayloadComponentContent(eventType, xpp, res))
7954        unknownContent(xpp);
7955      eventType = nextNoWhitespace(xpp);
7956    }
7957    next(xpp);
7958    parseElementClose(res);
7959    return res;
7960  }
7961
7962  protected boolean parseCommunicationRequestPayloadComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest.CommunicationRequestPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7963    if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
7964      res.setContent(parseType("content", xpp));
7965    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
7966      return false;
7967    }
7968    return true;
7969  }
7970
7971  protected CompartmentDefinition parseCompartmentDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7972    CompartmentDefinition res = new CompartmentDefinition();
7973    parseResourceAttributes(xpp, res);
7974    next(xpp);
7975    int eventType = nextNoWhitespace(xpp);
7976    while (eventType != XmlPullParser.END_TAG) {
7977    if (!parseCompartmentDefinitionContent(eventType, xpp, res))
7978        unknownContent(xpp);
7979      eventType = nextNoWhitespace(xpp);
7980    }
7981    next(xpp);
7982    parseElementClose(res);
7983    return res;
7984  }
7985
7986  protected boolean parseCompartmentDefinitionContent(int eventType, XmlPullParser xpp, CompartmentDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
7987    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7988      res.setUrlElement(parseUri(xpp));
7989    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7990      res.setVersionElement(parseString(xpp));
7991    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
7992      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
7993    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7994      res.setNameElement(parseString(xpp));
7995    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
7996      res.setTitleElement(parseString(xpp));
7997    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7998      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7999    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
8000      res.setExperimentalElement(parseBoolean(xpp));
8001    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8002      res.setDateElement(parseDateTime(xpp));
8003    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
8004      res.setPublisherElement(parseString(xpp));
8005    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
8006      res.getContact().add(parseContactDetail(xpp));
8007    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8008      res.setDescriptionElement(parseMarkdown(xpp));
8009    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8010      res.getUseContext().add(parseUsageContext(xpp));
8011    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
8012      res.setPurposeElement(parseMarkdown(xpp));
8013    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8014      res.setCodeElement(parseEnumeration(xpp, Enumerations.CompartmentType.NULL, new Enumerations.CompartmentTypeEnumFactory()));
8015    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
8016      res.setSearchElement(parseBoolean(xpp));
8017    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
8018      res.getResource().add(parseCompartmentDefinitionResourceComponent(xpp));
8019    } else if (!parseCanonicalResourceContent(eventType, xpp, res)){ 
8020      return false;
8021    }
8022    return true;
8023  }
8024
8025  protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionResourceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8026    CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent();
8027    parseElementAttributes(xpp, res);
8028    next(xpp);
8029    int eventType = nextNoWhitespace(xpp);
8030    while (eventType != XmlPullParser.END_TAG) {
8031    if (!parseCompartmentDefinitionResourceComponentContent(eventType, xpp, res))
8032        unknownContent(xpp);
8033      eventType = nextNoWhitespace(xpp);
8034    }
8035    next(xpp);
8036    parseElementClose(res);
8037    return res;
8038  }
8039
8040  protected boolean parseCompartmentDefinitionResourceComponentContent(int eventType, XmlPullParser xpp, CompartmentDefinition.CompartmentDefinitionResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8041    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8042      res.setCodeElement(parseCode(xpp));
8043    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
8044      res.getParam().add(parseString(xpp));
8045    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
8046      res.setDocumentationElement(parseString(xpp));
8047    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("startParam")) {
8048      res.setStartParamElement(parseUri(xpp));
8049    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endParam")) {
8050      res.setEndParamElement(parseUri(xpp));
8051    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8052      return false;
8053    }
8054    return true;
8055  }
8056
8057  protected Composition parseComposition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8058    Composition res = new Composition();
8059    parseResourceAttributes(xpp, res);
8060    next(xpp);
8061    int eventType = nextNoWhitespace(xpp);
8062    while (eventType != XmlPullParser.END_TAG) {
8063    if (!parseCompositionContent(eventType, xpp, res))
8064        unknownContent(xpp);
8065      eventType = nextNoWhitespace(xpp);
8066    }
8067    next(xpp);
8068    parseElementClose(res);
8069    return res;
8070  }
8071
8072  protected boolean parseCompositionContent(int eventType, XmlPullParser xpp, Composition res) throws XmlPullParserException, IOException, FHIRFormatError {
8073    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8074      res.setUrlElement(parseUri(xpp));
8075    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8076      res.getIdentifier().add(parseIdentifier(xpp));
8077    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
8078      res.setVersionElement(parseString(xpp));
8079    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8080      res.setStatusElement(parseEnumeration(xpp, Enumerations.CompositionStatus.NULL, new Enumerations.CompositionStatusEnumFactory()));
8081    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8082      res.setType(parseCodeableConcept(xpp));
8083    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8084      res.getCategory().add(parseCodeableConcept(xpp));
8085    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
8086      res.getSubject().add(parseReference(xpp));
8087    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
8088      res.setEncounter(parseReference(xpp));
8089    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8090      res.setDateElement(parseDateTime(xpp));
8091    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8092      res.getUseContext().add(parseUsageContext(xpp));
8093    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
8094      res.getAuthor().add(parseReference(xpp));
8095    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8096      res.setNameElement(parseString(xpp));
8097    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
8098      res.setTitleElement(parseString(xpp));
8099    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
8100      res.getNote().add(parseAnnotation(xpp));
8101    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attester")) {
8102      res.getAttester().add(parseCompositionAttesterComponent(xpp));
8103    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
8104      res.setCustodian(parseReference(xpp));
8105    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
8106      res.getRelatesTo().add(parseRelatedArtifact(xpp));
8107    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
8108      res.getEvent().add(parseCompositionEventComponent(xpp));
8109    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
8110      res.getSection().add(parseCompositionSectionComponent(xpp));
8111    } else if (!parseDomainResourceContent(eventType, xpp, res)){ 
8112      return false;
8113    }
8114    return true;
8115  }
8116
8117  protected Composition.CompositionAttesterComponent parseCompositionAttesterComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8118    Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent();
8119    parseElementAttributes(xpp, res);
8120    next(xpp);
8121    int eventType = nextNoWhitespace(xpp);
8122    while (eventType != XmlPullParser.END_TAG) {
8123    if (!parseCompositionAttesterComponentContent(eventType, xpp, res))
8124        unknownContent(xpp);
8125      eventType = nextNoWhitespace(xpp);
8126    }
8127    next(xpp);
8128    parseElementClose(res);
8129    return res;
8130  }
8131
8132  protected boolean parseCompositionAttesterComponentContent(int eventType, XmlPullParser xpp, Composition.CompositionAttesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8133    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
8134      res.setMode(parseCodeableConcept(xpp));
8135    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
8136      res.setTimeElement(parseDateTime(xpp));
8137    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
8138      res.setParty(parseReference(xpp));
8139    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8140      return false;
8141    }
8142    return true;
8143  }
8144
8145  protected Composition.CompositionEventComponent parseCompositionEventComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8146    Composition.CompositionEventComponent res = new Composition.CompositionEventComponent();
8147    parseElementAttributes(xpp, res);
8148    next(xpp);
8149    int eventType = nextNoWhitespace(xpp);
8150    while (eventType != XmlPullParser.END_TAG) {
8151    if (!parseCompositionEventComponentContent(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 parseCompositionEventComponentContent(int eventType, XmlPullParser xpp, Composition.CompositionEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8161    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
8162      res.setPeriod(parsePeriod(xpp));
8163    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
8164      res.getDetail().add(parseCodeableReference(xpp));
8165    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8166      return false;
8167    }
8168    return true;
8169  }
8170
8171  protected Composition.SectionComponent parseCompositionSectionComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8172    Composition.SectionComponent res = new Composition.SectionComponent();
8173    parseElementAttributes(xpp, res);
8174    next(xpp);
8175    int eventType = nextNoWhitespace(xpp);
8176    while (eventType != XmlPullParser.END_TAG) {
8177    if (!parseCompositionSectionComponentContent(eventType, xpp, res))
8178        unknownContent(xpp);
8179      eventType = nextNoWhitespace(xpp);
8180    }
8181    next(xpp);
8182    parseElementClose(res);
8183    return res;
8184  }
8185
8186  protected boolean parseCompositionSectionComponentContent(int eventType, XmlPullParser xpp, Composition.SectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8187    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
8188      res.setTitleElement(parseString(xpp));
8189    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8190      res.setCode(parseCodeableConcept(xpp));
8191    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
8192      res.getAuthor().add(parseReference(xpp));
8193    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
8194      res.setFocus(parseReference(xpp));
8195    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
8196      res.setText(parseNarrative(xpp));
8197    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
8198      res.setOrderedBy(parseCodeableConcept(xpp));
8199    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
8200      res.getEntry().add(parseReference(xpp));
8201    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
8202      res.setEmptyReason(parseCodeableConcept(xpp));
8203    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
8204      res.getSection().add(parseCompositionSectionComponent(xpp));
8205    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8206      return false;
8207    }
8208    return true;
8209  }
8210
8211  protected ConceptMap parseConceptMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8212    ConceptMap res = new ConceptMap();
8213    parseResourceAttributes(xpp, res);
8214    next(xpp);
8215    int eventType = nextNoWhitespace(xpp);
8216    while (eventType != XmlPullParser.END_TAG) {
8217    if (!parseConceptMapContent(eventType, xpp, res))
8218        unknownContent(xpp);
8219      eventType = nextNoWhitespace(xpp);
8220    }
8221    next(xpp);
8222    parseElementClose(res);
8223    return res;
8224  }
8225
8226  protected boolean parseConceptMapContent(int eventType, XmlPullParser xpp, ConceptMap res) throws XmlPullParserException, IOException, FHIRFormatError {
8227    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
8228      res.setUrlElement(parseUri(xpp));
8229    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8230      res.getIdentifier().add(parseIdentifier(xpp));
8231    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
8232      res.setVersionElement(parseString(xpp));
8233    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "versionAlgorithm")) {
8234      res.setVersionAlgorithm(parseType("versionAlgorithm", xpp));
8235    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
8236      res.setNameElement(parseString(xpp));
8237    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
8238      res.setTitleElement(parseString(xpp));
8239    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8240      res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
8241    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
8242      res.setExperimentalElement(parseBoolean(xpp));
8243    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8244      res.setDateElement(parseDateTime(xpp));
8245    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
8246      res.setPublisherElement(parseString(xpp));
8247    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
8248      res.getContact().add(parseContactDetail(xpp));
8249    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8250      res.setDescriptionElement(parseMarkdown(xpp));
8251    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
8252      res.getUseContext().add(parseUsageContext(xpp));
8253    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
8254      res.getJurisdiction().add(parseCodeableConcept(xpp));
8255    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
8256      res.setPurposeElement(parseMarkdown(xpp));
8257    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
8258      res.setCopyrightElement(parseMarkdown(xpp));
8259    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyrightLabel")) {
8260      res.setCopyrightLabelElement(parseString(xpp));
8261    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
8262      res.setApprovalDateElement(parseDate(xpp));
8263    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
8264      res.setLastReviewDateElement(parseDate(xpp));
8265    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
8266      res.setEffectivePeriod(parsePeriod(xpp));
8267    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
8268      res.getTopic().add(parseCodeableConcept(xpp));
8269    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
8270      res.getAuthor().add(parseContactDetail(xpp));
8271    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("editor")) {
8272      res.getEditor().add(parseContactDetail(xpp));
8273    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reviewer")) {
8274      res.getReviewer().add(parseContactDetail(xpp));
8275    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endorser")) {
8276      res.getEndorser().add(parseContactDetail(xpp));
8277    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
8278      res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
8279    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
8280      res.getProperty().add(parseConceptMapPropertyComponent(xpp));
8281    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalAttribute")) {
8282      res.getAdditionalAttribute().add(parseConceptMapAdditionalAttributeComponent(xpp));
8283    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "sourceScope")) {
8284      res.setSourceScope(parseType("sourceScope", xpp));
8285    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "targetScope")) {
8286      res.setTargetScope(parseType("targetScope", xpp));
8287    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
8288      res.getGroup().add(parseConceptMapGroupComponent(xpp));
8289    } else if (!parseMetadataResourceContent(eventType, xpp, res)){ 
8290      return false;
8291    }
8292    return true;
8293  }
8294
8295  protected ConceptMap.PropertyComponent parseConceptMapPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8296    ConceptMap.PropertyComponent res = new ConceptMap.PropertyComponent();
8297    parseElementAttributes(xpp, res);
8298    next(xpp);
8299    int eventType = nextNoWhitespace(xpp);
8300    while (eventType != XmlPullParser.END_TAG) {
8301    if (!parseConceptMapPropertyComponentContent(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 parseConceptMapPropertyComponentContent(int eventType, XmlPullParser xpp, ConceptMap.PropertyComponent 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("uri")) {
8314      res.setUriElement(parseUri(xpp));
8315    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8316      res.setDescriptionElement(parseString(xpp));
8317    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8318      res.setTypeElement(parseEnumeration(xpp, ConceptMap.ConceptMapPropertyType.NULL, new ConceptMap.ConceptMapPropertyTypeEnumFactory()));
8319    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
8320      res.setSystemElement(parseCanonical(xpp));
8321    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8322      return false;
8323    }
8324    return true;
8325  }
8326
8327  protected ConceptMap.AdditionalAttributeComponent parseConceptMapAdditionalAttributeComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8328    ConceptMap.AdditionalAttributeComponent res = new ConceptMap.AdditionalAttributeComponent();
8329    parseElementAttributes(xpp, res);
8330    next(xpp);
8331    int eventType = nextNoWhitespace(xpp);
8332    while (eventType != XmlPullParser.END_TAG) {
8333    if (!parseConceptMapAdditionalAttributeComponentContent(eventType, xpp, res))
8334        unknownContent(xpp);
8335      eventType = nextNoWhitespace(xpp);
8336    }
8337    next(xpp);
8338    parseElementClose(res);
8339    return res;
8340  }
8341
8342  protected boolean parseConceptMapAdditionalAttributeComponentContent(int eventType, XmlPullParser xpp, ConceptMap.AdditionalAttributeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8343    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8344      res.setCodeElement(parseCode(xpp));
8345    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
8346      res.setUriElement(parseUri(xpp));
8347    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
8348      res.setDescriptionElement(parseString(xpp));
8349    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8350      res.setTypeElement(parseEnumeration(xpp, ConceptMap.ConceptMapAttributeType.NULL, new ConceptMap.ConceptMapAttributeTypeEnumFactory()));
8351    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8352      return false;
8353    }
8354    return true;
8355  }
8356
8357  protected ConceptMap.ConceptMapGroupComponent parseConceptMapGroupComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8358    ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent();
8359    parseElementAttributes(xpp, res);
8360    next(xpp);
8361    int eventType = nextNoWhitespace(xpp);
8362    while (eventType != XmlPullParser.END_TAG) {
8363    if (!parseConceptMapGroupComponentContent(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 parseConceptMapGroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap.ConceptMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8373    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
8374      res.setSourceElement(parseCanonical(xpp));
8375    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8376      res.setTargetElement(parseCanonical(xpp));
8377    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
8378      res.getElement().add(parseConceptMapSourceElementComponent(xpp));
8379    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
8380      res.setUnmapped(parseConceptMapGroupUnmappedComponent(xpp));
8381    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8382      return false;
8383    }
8384    return true;
8385  }
8386
8387  protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8388    ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent();
8389    parseElementAttributes(xpp, res);
8390    next(xpp);
8391    int eventType = nextNoWhitespace(xpp);
8392    while (eventType != XmlPullParser.END_TAG) {
8393    if (!parseConceptMapSourceElementComponentContent(eventType, xpp, res))
8394        unknownContent(xpp);
8395      eventType = nextNoWhitespace(xpp);
8396    }
8397    next(xpp);
8398    parseElementClose(res);
8399    return res;
8400  }
8401
8402  protected boolean parseConceptMapSourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8403    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8404      res.setCodeElement(parseCode(xpp));
8405    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8406      res.setDisplayElement(parseString(xpp));
8407    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8408      res.setValueSetElement(parseCanonical(xpp));
8409    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noMap")) {
8410      res.setNoMapElement(parseBoolean(xpp));
8411    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
8412      res.getTarget().add(parseConceptMapTargetElementComponent(xpp));
8413    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8414      return false;
8415    }
8416    return true;
8417  }
8418
8419  protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8420    ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent();
8421    parseElementAttributes(xpp, res);
8422    next(xpp);
8423    int eventType = nextNoWhitespace(xpp);
8424    while (eventType != XmlPullParser.END_TAG) {
8425    if (!parseConceptMapTargetElementComponentContent(eventType, xpp, res))
8426        unknownContent(xpp);
8427      eventType = nextNoWhitespace(xpp);
8428    }
8429    next(xpp);
8430    parseElementClose(res);
8431    return res;
8432  }
8433
8434  protected boolean parseConceptMapTargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8435    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8436      res.setCodeElement(parseCode(xpp));
8437    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
8438      res.setDisplayElement(parseString(xpp));
8439    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8440      res.setValueSetElement(parseCanonical(xpp));
8441    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8442      res.setRelationshipElement(parseEnumeration(xpp, Enumerations.ConceptMapRelationship.NULL, new Enumerations.ConceptMapRelationshipEnumFactory()));
8443    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
8444      res.setCommentElement(parseString(xpp));
8445    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
8446      res.getProperty().add(parseConceptMapMappingPropertyComponent(xpp));
8447    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
8448      res.getDependsOn().add(parseConceptMapOtherElementComponent(xpp));
8449    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
8450      res.getProduct().add(parseConceptMapOtherElementComponent(xpp));
8451    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8452      return false;
8453    }
8454    return true;
8455  }
8456
8457  protected ConceptMap.MappingPropertyComponent parseConceptMapMappingPropertyComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8458    ConceptMap.MappingPropertyComponent res = new ConceptMap.MappingPropertyComponent();
8459    parseElementAttributes(xpp, res);
8460    next(xpp);
8461    int eventType = nextNoWhitespace(xpp);
8462    while (eventType != XmlPullParser.END_TAG) {
8463    if (!parseConceptMapMappingPropertyComponentContent(eventType, xpp, res))
8464        unknownContent(xpp);
8465      eventType = nextNoWhitespace(xpp);
8466    }
8467    next(xpp);
8468    parseElementClose(res);
8469    return res;
8470  }
8471
8472  protected boolean parseConceptMapMappingPropertyComponentContent(int eventType, XmlPullParser xpp, ConceptMap.MappingPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8473    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8474      res.setCodeElement(parseCode(xpp));
8475    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8476      res.setValue(parseType("value", xpp));
8477    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8478      return false;
8479    }
8480    return true;
8481  }
8482
8483  protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8484    ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent();
8485    parseElementAttributes(xpp, res);
8486    next(xpp);
8487    int eventType = nextNoWhitespace(xpp);
8488    while (eventType != XmlPullParser.END_TAG) {
8489    if (!parseConceptMapOtherElementComponentContent(eventType, xpp, res))
8490        unknownContent(xpp);
8491      eventType = nextNoWhitespace(xpp);
8492    }
8493    next(xpp);
8494    parseElementClose(res);
8495    return res;
8496  }
8497
8498  protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8499    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attribute")) {
8500      res.setAttributeElement(parseCode(xpp));
8501    } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8502      res.setValue(parseType("value", xpp));
8503    } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
8504      res.setValueSetElement(parseCanonical(xpp));
8505    } else if (!parseBackboneElementContent(eventType, xpp, res)){ 
8506      return false;
8507    }
8508    return true;
8509  }
8510
8511  protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapGroupUnmappedComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8512    ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent();
8513    parseElementAttributes(xpp, res);
8514    next(xpp);
8515    int eventType = nextNoWhitespace(xpp);
8516    while (eventType != XmlPullParser.END_TAG) {
<