001package org.hl7.fhir.dstu3.formats;
002
003import java.io.IOException;
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
034// Generated on Mon, Apr 17, 2017 08:38+1000 for FHIR v3.0.x
035import org.hl7.fhir.dstu3.model.*;
036import org.hl7.fhir.exceptions.FHIRFormatError;
037import org.hl7.fhir.utilities.Utilities;
038import org.xmlpull.v1.XmlPullParser;
039import org.xmlpull.v1.XmlPullParserException;
040
041public class XmlParser extends XmlParserBase {
042
043  public XmlParser() {
044    super();
045  }
046
047  public XmlParser(boolean allowUnknownContent) {
048    super();
049    setAllowUnknownContent(allowUnknownContent);
050  }
051
052
053  protected boolean parseElementContent(int eventType, XmlPullParser xpp, Element res) throws XmlPullParserException, IOException, FHIRFormatError {
054    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) 
055      res.getExtension().add(parseExtension(xpp));
056    else
057      return false;
058      
059    return true;
060  }
061
062  protected boolean parseBackboneContent(int eventType, XmlPullParser xpp, BackboneElement res) throws XmlPullParserException, IOException, FHIRFormatError {
063    if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) 
064      res.getModifierExtension().add(parseExtension(xpp));
065    else
066      return parseElementContent(eventType, xpp, res);
067      
068    return true;
069  }
070
071  @SuppressWarnings("unchecked")
072  protected <E extends Enum<E>> Enumeration<E> parseEnumeration(XmlPullParser xpp, E item, EnumFactory e) throws XmlPullParserException, IOException, FHIRFormatError {
073    Enumeration<E> res = new Enumeration<E>(e);
074    parseElementAttributes(xpp, res);
075    res.setValue((E) e.fromCode(xpp.getAttributeValue(null, "value")));
076    next(xpp);
077    int eventType = nextNoWhitespace(xpp);
078    while (eventType != XmlPullParser.END_TAG) {
079      if (!parseElementContent(eventType, xpp, res))
080        unknownContent(xpp);
081      eventType = nextNoWhitespace(xpp);
082    }
083    next(xpp);
084    parseElementClose(res);
085    return res;
086  }
087
088  protected DateType parseDate(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
089    DateType res = new DateType(xpp.getAttributeValue(null, "value"));
090    parseElementAttributes(xpp, res);
091    next(xpp);
092    int eventType = nextNoWhitespace(xpp);
093    while (eventType != XmlPullParser.END_TAG) {
094      if (!parseElementContent(eventType, xpp, res))
095        unknownContent(xpp);
096      eventType = nextNoWhitespace(xpp);
097    }
098    next(xpp);
099    parseElementClose(res);
100    return res;
101  }
102
103  protected DateTimeType parseDateTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
104    DateTimeType res = new DateTimeType(xpp.getAttributeValue(null, "value"));
105    parseElementAttributes(xpp, res);
106    next(xpp);
107    int eventType = nextNoWhitespace(xpp);
108    while (eventType != XmlPullParser.END_TAG) {
109      if (!parseElementContent(eventType, xpp, res))
110        unknownContent(xpp);
111      eventType = nextNoWhitespace(xpp);
112    }
113    next(xpp);
114    parseElementClose(res);
115    return res;
116  }
117
118  protected CodeType parseCode(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
119    CodeType res = new CodeType(xpp.getAttributeValue(null, "value"));
120    parseElementAttributes(xpp, res);
121    next(xpp);
122    int eventType = nextNoWhitespace(xpp);
123    while (eventType != XmlPullParser.END_TAG) {
124      if (!parseElementContent(eventType, xpp, res))
125        unknownContent(xpp);
126      eventType = nextNoWhitespace(xpp);
127    }
128    next(xpp);
129    parseElementClose(res);
130    return res;
131  }
132
133  protected StringType parseString(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
134    StringType res = new StringType(xpp.getAttributeValue(null, "value"));
135    parseElementAttributes(xpp, res);
136    next(xpp);
137    int eventType = nextNoWhitespace(xpp);
138    while (eventType != XmlPullParser.END_TAG) {
139      if (!parseElementContent(eventType, xpp, res))
140        unknownContent(xpp);
141      eventType = nextNoWhitespace(xpp);
142    }
143    next(xpp);
144    parseElementClose(res);
145    return res;
146  }
147
148  protected IntegerType parseInteger(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
149    IntegerType res = new IntegerType(xpp.getAttributeValue(null, "value"));
150    parseElementAttributes(xpp, res);
151    next(xpp);
152    int eventType = nextNoWhitespace(xpp);
153    while (eventType != XmlPullParser.END_TAG) {
154      if (!parseElementContent(eventType, xpp, res))
155        unknownContent(xpp);
156      eventType = nextNoWhitespace(xpp);
157    }
158    next(xpp);
159    parseElementClose(res);
160    return res;
161  }
162
163  protected OidType parseOid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
164    OidType res = new OidType(xpp.getAttributeValue(null, "value"));
165    parseElementAttributes(xpp, res);
166    next(xpp);
167    int eventType = nextNoWhitespace(xpp);
168    while (eventType != XmlPullParser.END_TAG) {
169      if (!parseElementContent(eventType, xpp, res))
170        unknownContent(xpp);
171      eventType = nextNoWhitespace(xpp);
172    }
173    next(xpp);
174    parseElementClose(res);
175    return res;
176  }
177
178  protected UriType parseUri(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
179    UriType res = new UriType(xpp.getAttributeValue(null, "value"));
180    parseElementAttributes(xpp, res);
181    next(xpp);
182    int eventType = nextNoWhitespace(xpp);
183    while (eventType != XmlPullParser.END_TAG) {
184      if (!parseElementContent(eventType, xpp, res))
185        unknownContent(xpp);
186      eventType = nextNoWhitespace(xpp);
187    }
188    next(xpp);
189    parseElementClose(res);
190    return res;
191  }
192
193  protected UuidType parseUuid(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
194    UuidType res = new UuidType(xpp.getAttributeValue(null, "value"));
195    parseElementAttributes(xpp, res);
196    next(xpp);
197    int eventType = nextNoWhitespace(xpp);
198    while (eventType != XmlPullParser.END_TAG) {
199      if (!parseElementContent(eventType, xpp, res))
200        unknownContent(xpp);
201      eventType = nextNoWhitespace(xpp);
202    }
203    next(xpp);
204    parseElementClose(res);
205    return res;
206  }
207
208  protected InstantType parseInstant(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
209    InstantType res = new InstantType(xpp.getAttributeValue(null, "value"));
210    parseElementAttributes(xpp, res);
211    next(xpp);
212    int eventType = nextNoWhitespace(xpp);
213    while (eventType != XmlPullParser.END_TAG) {
214      if (!parseElementContent(eventType, xpp, res))
215        unknownContent(xpp);
216      eventType = nextNoWhitespace(xpp);
217    }
218    next(xpp);
219    parseElementClose(res);
220    return res;
221  }
222
223  protected BooleanType parseBoolean(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
224    BooleanType res = new BooleanType(xpp.getAttributeValue(null, "value"));
225    parseElementAttributes(xpp, res);
226    next(xpp);
227    int eventType = nextNoWhitespace(xpp);
228    while (eventType != XmlPullParser.END_TAG) {
229      if (!parseElementContent(eventType, xpp, res))
230        unknownContent(xpp);
231      eventType = nextNoWhitespace(xpp);
232    }
233    next(xpp);
234    parseElementClose(res);
235    return res;
236  }
237
238  protected Base64BinaryType parseBase64Binary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
239    Base64BinaryType res = new Base64BinaryType(xpp.getAttributeValue(null, "value"));
240    parseElementAttributes(xpp, res);
241    next(xpp);
242    int eventType = nextNoWhitespace(xpp);
243    while (eventType != XmlPullParser.END_TAG) {
244      if (!parseElementContent(eventType, xpp, res))
245        unknownContent(xpp);
246      eventType = nextNoWhitespace(xpp);
247    }
248    next(xpp);
249    parseElementClose(res);
250    return res;
251  }
252
253  protected UnsignedIntType parseUnsignedInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
254    UnsignedIntType res = new UnsignedIntType(xpp.getAttributeValue(null, "value"));
255    parseElementAttributes(xpp, res);
256    next(xpp);
257    int eventType = nextNoWhitespace(xpp);
258    while (eventType != XmlPullParser.END_TAG) {
259      if (!parseElementContent(eventType, xpp, res))
260        unknownContent(xpp);
261      eventType = nextNoWhitespace(xpp);
262    }
263    next(xpp);
264    parseElementClose(res);
265    return res;
266  }
267
268  protected MarkdownType parseMarkdown(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
269    MarkdownType res = new MarkdownType(xpp.getAttributeValue(null, "value"));
270    parseElementAttributes(xpp, res);
271    next(xpp);
272    int eventType = nextNoWhitespace(xpp);
273    while (eventType != XmlPullParser.END_TAG) {
274      if (!parseElementContent(eventType, xpp, res))
275        unknownContent(xpp);
276      eventType = nextNoWhitespace(xpp);
277    }
278    next(xpp);
279    parseElementClose(res);
280    return res;
281  }
282
283  protected TimeType parseTime(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
284    TimeType res = new TimeType(xpp.getAttributeValue(null, "value"));
285    parseElementAttributes(xpp, res);
286    next(xpp);
287    int eventType = nextNoWhitespace(xpp);
288    while (eventType != XmlPullParser.END_TAG) {
289      if (!parseElementContent(eventType, xpp, res))
290        unknownContent(xpp);
291      eventType = nextNoWhitespace(xpp);
292    }
293    next(xpp);
294    parseElementClose(res);
295    return res;
296  }
297
298  protected IdType parseId(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
299    IdType res = new IdType(xpp.getAttributeValue(null, "value"));
300    parseElementAttributes(xpp, res);
301    next(xpp);
302    int eventType = nextNoWhitespace(xpp);
303    while (eventType != XmlPullParser.END_TAG) {
304      if (!parseElementContent(eventType, xpp, res))
305        unknownContent(xpp);
306      eventType = nextNoWhitespace(xpp);
307    }
308    next(xpp);
309    parseElementClose(res);
310    return res;
311  }
312
313  protected PositiveIntType parsePositiveInt(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
314    PositiveIntType res = new PositiveIntType(xpp.getAttributeValue(null, "value"));
315    parseElementAttributes(xpp, res);
316    next(xpp);
317    int eventType = nextNoWhitespace(xpp);
318    while (eventType != XmlPullParser.END_TAG) {
319      if (!parseElementContent(eventType, xpp, res))
320        unknownContent(xpp);
321      eventType = nextNoWhitespace(xpp);
322    }
323    next(xpp);
324    parseElementClose(res);
325    return res;
326  }
327
328  protected DecimalType parseDecimal(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
329    DecimalType res = new DecimalType(xpp.getAttributeValue(null, "value"));
330    parseElementAttributes(xpp, res);
331    next(xpp);
332    int eventType = nextNoWhitespace(xpp);
333    while (eventType != XmlPullParser.END_TAG) {
334      if (!parseElementContent(eventType, xpp, res))
335        unknownContent(xpp);
336      eventType = nextNoWhitespace(xpp);
337    }
338    next(xpp);
339    parseElementClose(res);
340    return res;
341  }
342
343  protected Extension parseExtension(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
344    Extension res = new Extension();
345    parseElementAttributes(xpp, res);
346    if (xpp.getAttributeValue(null, "url") != null)
347        res.setUrl(xpp.getAttributeValue(null, "url"));
348    next(xpp);
349    int eventType = nextNoWhitespace(xpp);
350    while (eventType != XmlPullParser.END_TAG) {
351  if (!parseExtensionContent(eventType, xpp, res))
352        unknownContent(xpp);
353      eventType = nextNoWhitespace(xpp);
354    }
355    next(xpp);
356    parseElementClose(res);
357    return res;
358  }
359
360  protected boolean parseExtensionContent(int eventType, XmlPullParser xpp, Extension res) throws XmlPullParserException, IOException, FHIRFormatError {
361      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
362        res.setValue(parseType("value", xpp));
363      } else if (!parseElementContent(eventType, xpp, res))
364        return false;
365    return true;
366  }
367
368  protected Narrative parseNarrative(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
369    Narrative res = new Narrative();
370    parseElementAttributes(xpp, res);
371    next(xpp);
372    int eventType = nextNoWhitespace(xpp);
373    while (eventType != XmlPullParser.END_TAG) {
374  if (!parseNarrativeContent(eventType, xpp, res))
375        unknownContent(xpp);
376      eventType = nextNoWhitespace(xpp);
377    }
378    next(xpp);
379    parseElementClose(res);
380    return res;
381  }
382
383  protected boolean parseNarrativeContent(int eventType, XmlPullParser xpp, Narrative res) throws XmlPullParserException, IOException, FHIRFormatError {
384      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
385        res.setStatusElement(parseEnumeration(xpp, Narrative.NarrativeStatus.NULL, new Narrative.NarrativeStatusEnumFactory()));
386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("div")) {
387        res.setDiv(parseXhtml(xpp));
388      } else if (!parseElementContent(eventType, xpp, res))
389        return false;
390    return true;
391  }
392
393  protected Reference parseReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
394    Reference res = new Reference();
395    parseTypeAttributes(xpp, res);
396    next(xpp);
397    int eventType = nextNoWhitespace(xpp);
398    while (eventType != XmlPullParser.END_TAG) {
399  if (!parseReferenceContent(eventType, xpp, res))
400        unknownContent(xpp);
401      eventType = nextNoWhitespace(xpp);
402    }
403    next(xpp);
404    parseElementClose(res);
405    return res;
406  }
407
408  protected boolean parseReferenceContent(int eventType, XmlPullParser xpp, Reference res) throws XmlPullParserException, IOException, FHIRFormatError {
409      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
410        res.setReferenceElement(parseString(xpp));
411      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
412        res.setIdentifier(parseIdentifier(xpp));
413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
414        res.setDisplayElement(parseString(xpp));
415      } else if (!parseElementContent(eventType, xpp, res))
416        return false;
417    return true;
418  }
419
420  protected Quantity parseQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
421    Quantity res = new Quantity();
422    parseTypeAttributes(xpp, res);
423    next(xpp);
424    int eventType = nextNoWhitespace(xpp);
425    while (eventType != XmlPullParser.END_TAG) {
426  if (!parseQuantityContent(eventType, xpp, res))
427        unknownContent(xpp);
428      eventType = nextNoWhitespace(xpp);
429    }
430    next(xpp);
431    parseElementClose(res);
432    return res;
433  }
434
435  protected boolean parseQuantityContent(int eventType, XmlPullParser xpp, Quantity res) throws XmlPullParserException, IOException, FHIRFormatError {
436      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
437        res.setValueElement(parseDecimal(xpp));
438      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
439        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
441        res.setUnitElement(parseString(xpp));
442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
443        res.setSystemElement(parseUri(xpp));
444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
445        res.setCodeElement(parseCode(xpp));
446      } else if (!parseElementContent(eventType, xpp, res))
447        return false;
448    return true;
449  }
450
451  protected Period parsePeriod(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
452    Period res = new Period();
453    parseTypeAttributes(xpp, res);
454    next(xpp);
455    int eventType = nextNoWhitespace(xpp);
456    while (eventType != XmlPullParser.END_TAG) {
457  if (!parsePeriodContent(eventType, xpp, res))
458        unknownContent(xpp);
459      eventType = nextNoWhitespace(xpp);
460    }
461    next(xpp);
462    parseElementClose(res);
463    return res;
464  }
465
466  protected boolean parsePeriodContent(int eventType, XmlPullParser xpp, Period res) throws XmlPullParserException, IOException, FHIRFormatError {
467      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
468        res.setStartElement(parseDateTime(xpp));
469      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
470        res.setEndElement(parseDateTime(xpp));
471      } else if (!parseElementContent(eventType, xpp, res))
472        return false;
473    return true;
474  }
475
476  protected Attachment parseAttachment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
477    Attachment res = new Attachment();
478    parseTypeAttributes(xpp, res);
479    next(xpp);
480    int eventType = nextNoWhitespace(xpp);
481    while (eventType != XmlPullParser.END_TAG) {
482  if (!parseAttachmentContent(eventType, xpp, res))
483        unknownContent(xpp);
484      eventType = nextNoWhitespace(xpp);
485    }
486    next(xpp);
487    parseElementClose(res);
488    return res;
489  }
490
491  protected boolean parseAttachmentContent(int eventType, XmlPullParser xpp, Attachment res) throws XmlPullParserException, IOException, FHIRFormatError {
492      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
493        res.setContentTypeElement(parseCode(xpp));
494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
495        res.setLanguageElement(parseCode(xpp));
496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
497        res.setDataElement(parseBase64Binary(xpp));
498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
499        res.setUrlElement(parseUri(xpp));
500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("size")) {
501        res.setSizeElement(parseUnsignedInt(xpp));
502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hash")) {
503        res.setHashElement(parseBase64Binary(xpp));
504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
505        res.setTitleElement(parseString(xpp));
506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("creation")) {
507        res.setCreationElement(parseDateTime(xpp));
508      } else if (!parseElementContent(eventType, xpp, res))
509        return false;
510    return true;
511  }
512
513  protected Duration parseDuration(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
514    Duration res = new Duration();
515    parseTypeAttributes(xpp, res);
516    next(xpp);
517    int eventType = nextNoWhitespace(xpp);
518    while (eventType != XmlPullParser.END_TAG) {
519  if (!parseDurationContent(eventType, xpp, res))
520        unknownContent(xpp);
521      eventType = nextNoWhitespace(xpp);
522    }
523    next(xpp);
524    parseElementClose(res);
525    return res;
526  }
527
528  protected boolean parseDurationContent(int eventType, XmlPullParser xpp, Duration res) throws XmlPullParserException, IOException, FHIRFormatError {
529      if (!parseQuantityContent(eventType, xpp, res))
530        return false;
531    return true;
532  }
533
534  protected Count parseCount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
535    Count res = new Count();
536    parseTypeAttributes(xpp, res);
537    next(xpp);
538    int eventType = nextNoWhitespace(xpp);
539    while (eventType != XmlPullParser.END_TAG) {
540  if (!parseCountContent(eventType, xpp, res))
541        unknownContent(xpp);
542      eventType = nextNoWhitespace(xpp);
543    }
544    next(xpp);
545    parseElementClose(res);
546    return res;
547  }
548
549  protected boolean parseCountContent(int eventType, XmlPullParser xpp, Count res) throws XmlPullParserException, IOException, FHIRFormatError {
550      if (!parseQuantityContent(eventType, xpp, res))
551        return false;
552    return true;
553  }
554
555  protected Range parseRange(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
556    Range res = new Range();
557    parseTypeAttributes(xpp, res);
558    next(xpp);
559    int eventType = nextNoWhitespace(xpp);
560    while (eventType != XmlPullParser.END_TAG) {
561  if (!parseRangeContent(eventType, xpp, res))
562        unknownContent(xpp);
563      eventType = nextNoWhitespace(xpp);
564    }
565    next(xpp);
566    parseElementClose(res);
567    return res;
568  }
569
570  protected boolean parseRangeContent(int eventType, XmlPullParser xpp, Range res) throws XmlPullParserException, IOException, FHIRFormatError {
571      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("low")) {
572        res.setLow(parseSimpleQuantity(xpp));
573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("high")) {
574        res.setHigh(parseSimpleQuantity(xpp));
575      } else if (!parseElementContent(eventType, xpp, res))
576        return false;
577    return true;
578  }
579
580  protected Annotation parseAnnotation(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
581    Annotation res = new Annotation();
582    parseTypeAttributes(xpp, res);
583    next(xpp);
584    int eventType = nextNoWhitespace(xpp);
585    while (eventType != XmlPullParser.END_TAG) {
586  if (!parseAnnotationContent(eventType, xpp, res))
587        unknownContent(xpp);
588      eventType = nextNoWhitespace(xpp);
589    }
590    next(xpp);
591    parseElementClose(res);
592    return res;
593  }
594
595  protected boolean parseAnnotationContent(int eventType, XmlPullParser xpp, Annotation res) throws XmlPullParserException, IOException, FHIRFormatError {
596      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "author")) {
597        res.setAuthor(parseType("author", xpp));
598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
599        res.setTimeElement(parseDateTime(xpp));
600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
601        res.setTextElement(parseString(xpp));
602      } else if (!parseElementContent(eventType, xpp, res))
603        return false;
604    return true;
605  }
606
607  protected Money parseMoney(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
608    Money res = new Money();
609    parseTypeAttributes(xpp, res);
610    next(xpp);
611    int eventType = nextNoWhitespace(xpp);
612    while (eventType != XmlPullParser.END_TAG) {
613  if (!parseMoneyContent(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 parseMoneyContent(int eventType, XmlPullParser xpp, Money res) throws XmlPullParserException, IOException, FHIRFormatError {
623      if (!parseQuantityContent(eventType, xpp, res))
624        return false;
625    return true;
626  }
627
628  protected Identifier parseIdentifier(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
629    Identifier res = new Identifier();
630    parseTypeAttributes(xpp, res);
631    next(xpp);
632    int eventType = nextNoWhitespace(xpp);
633    while (eventType != XmlPullParser.END_TAG) {
634  if (!parseIdentifierContent(eventType, xpp, res))
635        unknownContent(xpp);
636      eventType = nextNoWhitespace(xpp);
637    }
638    next(xpp);
639    parseElementClose(res);
640    return res;
641  }
642
643  protected boolean parseIdentifierContent(int eventType, XmlPullParser xpp, Identifier res) throws XmlPullParserException, IOException, FHIRFormatError {
644      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
645        res.setUseElement(parseEnumeration(xpp, Identifier.IdentifierUse.NULL, new Identifier.IdentifierUseEnumFactory()));
646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
647        res.setType(parseCodeableConcept(xpp));
648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
649        res.setSystemElement(parseUri(xpp));
650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
651        res.setValueElement(parseString(xpp));
652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
653        res.setPeriod(parsePeriod(xpp));
654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assigner")) {
655        res.setAssigner(parseReference(xpp));
656      } else if (!parseElementContent(eventType, xpp, res))
657        return false;
658    return true;
659  }
660
661  protected Coding parseCoding(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
662    Coding res = new Coding();
663    parseTypeAttributes(xpp, res);
664    next(xpp);
665    int eventType = nextNoWhitespace(xpp);
666    while (eventType != XmlPullParser.END_TAG) {
667  if (!parseCodingContent(eventType, xpp, res))
668        unknownContent(xpp);
669      eventType = nextNoWhitespace(xpp);
670    }
671    next(xpp);
672    parseElementClose(res);
673    return res;
674  }
675
676  protected boolean parseCodingContent(int eventType, XmlPullParser xpp, Coding res) throws XmlPullParserException, IOException, FHIRFormatError {
677      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
678        res.setSystemElement(parseUri(xpp));
679      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
680        res.setVersionElement(parseString(xpp));
681      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
682        res.setCodeElement(parseCode(xpp));
683      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
684        res.setDisplayElement(parseString(xpp));
685      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userSelected")) {
686        res.setUserSelectedElement(parseBoolean(xpp));
687      } else if (!parseElementContent(eventType, xpp, res))
688        return false;
689    return true;
690  }
691
692  protected Signature parseSignature(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
693    Signature res = new Signature();
694    parseTypeAttributes(xpp, res);
695    next(xpp);
696    int eventType = nextNoWhitespace(xpp);
697    while (eventType != XmlPullParser.END_TAG) {
698  if (!parseSignatureContent(eventType, xpp, res))
699        unknownContent(xpp);
700      eventType = nextNoWhitespace(xpp);
701    }
702    next(xpp);
703    parseElementClose(res);
704    return res;
705  }
706
707  protected boolean parseSignatureContent(int eventType, XmlPullParser xpp, Signature res) throws XmlPullParserException, IOException, FHIRFormatError {
708      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
709        res.getType().add(parseCoding(xpp));
710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
711        res.setWhenElement(parseInstant(xpp));
712      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "who")) {
713        res.setWho(parseType("who", xpp));
714      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onBehalfOf")) {
715        res.setOnBehalfOf(parseType("onBehalfOf", xpp));
716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
717        res.setContentTypeElement(parseCode(xpp));
718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
719        res.setBlobElement(parseBase64Binary(xpp));
720      } else if (!parseElementContent(eventType, xpp, res))
721        return false;
722    return true;
723  }
724
725  protected SampledData parseSampledData(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
726    SampledData res = new SampledData();
727    parseTypeAttributes(xpp, res);
728    next(xpp);
729    int eventType = nextNoWhitespace(xpp);
730    while (eventType != XmlPullParser.END_TAG) {
731  if (!parseSampledDataContent(eventType, xpp, res))
732        unknownContent(xpp);
733      eventType = nextNoWhitespace(xpp);
734    }
735    next(xpp);
736    parseElementClose(res);
737    return res;
738  }
739
740  protected boolean parseSampledDataContent(int eventType, XmlPullParser xpp, SampledData res) throws XmlPullParserException, IOException, FHIRFormatError {
741      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
742        res.setOrigin(parseSimpleQuantity(xpp));
743      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
744        res.setPeriodElement(parseDecimal(xpp));
745      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
746        res.setFactorElement(parseDecimal(xpp));
747      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lowerLimit")) {
748        res.setLowerLimitElement(parseDecimal(xpp));
749      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("upperLimit")) {
750        res.setUpperLimitElement(parseDecimal(xpp));
751      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dimensions")) {
752        res.setDimensionsElement(parsePositiveInt(xpp));
753      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
754        res.setDataElement(parseString(xpp));
755      } else if (!parseElementContent(eventType, xpp, res))
756        return false;
757    return true;
758  }
759
760  protected Ratio parseRatio(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
761    Ratio res = new Ratio();
762    parseTypeAttributes(xpp, res);
763    next(xpp);
764    int eventType = nextNoWhitespace(xpp);
765    while (eventType != XmlPullParser.END_TAG) {
766  if (!parseRatioContent(eventType, xpp, res))
767        unknownContent(xpp);
768      eventType = nextNoWhitespace(xpp);
769    }
770    next(xpp);
771    parseElementClose(res);
772    return res;
773  }
774
775  protected boolean parseRatioContent(int eventType, XmlPullParser xpp, Ratio res) throws XmlPullParserException, IOException, FHIRFormatError {
776      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("numerator")) {
777        res.setNumerator(parseQuantity(xpp));
778      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("denominator")) {
779        res.setDenominator(parseQuantity(xpp));
780      } else if (!parseElementContent(eventType, xpp, res))
781        return false;
782    return true;
783  }
784
785  protected Distance parseDistance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
786    Distance res = new Distance();
787    parseTypeAttributes(xpp, res);
788    next(xpp);
789    int eventType = nextNoWhitespace(xpp);
790    while (eventType != XmlPullParser.END_TAG) {
791  if (!parseDistanceContent(eventType, xpp, res))
792        unknownContent(xpp);
793      eventType = nextNoWhitespace(xpp);
794    }
795    next(xpp);
796    parseElementClose(res);
797    return res;
798  }
799
800  protected boolean parseDistanceContent(int eventType, XmlPullParser xpp, Distance res) throws XmlPullParserException, IOException, FHIRFormatError {
801      if (!parseQuantityContent(eventType, xpp, res))
802        return false;
803    return true;
804  }
805
806  protected Age parseAge(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
807    Age res = new Age();
808    parseTypeAttributes(xpp, res);
809    next(xpp);
810    int eventType = nextNoWhitespace(xpp);
811    while (eventType != XmlPullParser.END_TAG) {
812  if (!parseAgeContent(eventType, xpp, res))
813        unknownContent(xpp);
814      eventType = nextNoWhitespace(xpp);
815    }
816    next(xpp);
817    parseElementClose(res);
818    return res;
819  }
820
821  protected boolean parseAgeContent(int eventType, XmlPullParser xpp, Age res) throws XmlPullParserException, IOException, FHIRFormatError {
822      if (!parseQuantityContent(eventType, xpp, res))
823        return false;
824    return true;
825  }
826
827  protected CodeableConcept parseCodeableConcept(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
828    CodeableConcept res = new CodeableConcept();
829    parseTypeAttributes(xpp, res);
830    next(xpp);
831    int eventType = nextNoWhitespace(xpp);
832    while (eventType != XmlPullParser.END_TAG) {
833  if (!parseCodeableConceptContent(eventType, xpp, res))
834        unknownContent(xpp);
835      eventType = nextNoWhitespace(xpp);
836    }
837    next(xpp);
838    parseElementClose(res);
839    return res;
840  }
841
842  protected boolean parseCodeableConceptContent(int eventType, XmlPullParser xpp, CodeableConcept res) throws XmlPullParserException, IOException, FHIRFormatError {
843      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coding")) {
844        res.getCoding().add(parseCoding(xpp));
845      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
846        res.setTextElement(parseString(xpp));
847      } else if (!parseElementContent(eventType, xpp, res))
848        return false;
849    return true;
850  }
851
852  protected SimpleQuantity parseSimpleQuantity(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
853    SimpleQuantity res = new SimpleQuantity();
854    parseElementAttributes(xpp, res);
855    next(xpp);
856    int eventType = nextNoWhitespace(xpp);
857    while (eventType != XmlPullParser.END_TAG) {
858  if (!parseSimpleQuantityContent(eventType, xpp, res))
859        unknownContent(xpp);
860      eventType = nextNoWhitespace(xpp);
861    }
862    next(xpp);
863    parseElementClose(res);
864    return res;
865  }
866
867  protected boolean parseSimpleQuantityContent(int eventType, XmlPullParser xpp, SimpleQuantity res) throws XmlPullParserException, IOException, FHIRFormatError {
868      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
869        res.setValueElement(parseDecimal(xpp));
870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comparator")) {
871        res.setComparatorElement(parseEnumeration(xpp, Quantity.QuantityComparator.NULL, new Quantity.QuantityComparatorEnumFactory()));
872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
873        res.setUnitElement(parseString(xpp));
874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
875        res.setSystemElement(parseUri(xpp));
876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
877        res.setCodeElement(parseCode(xpp));
878      } else if (!parseElementContent(eventType, xpp, res))
879        return false;
880    return true;
881  }
882
883  protected Meta parseMeta(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
884    Meta res = new Meta();
885    parseElementAttributes(xpp, res);
886    next(xpp);
887    int eventType = nextNoWhitespace(xpp);
888    while (eventType != XmlPullParser.END_TAG) {
889  if (!parseMetaContent(eventType, xpp, res))
890        unknownContent(xpp);
891      eventType = nextNoWhitespace(xpp);
892    }
893    next(xpp);
894    parseElementClose(res);
895    return res;
896  }
897
898  protected boolean parseMetaContent(int eventType, XmlPullParser xpp, Meta res) throws XmlPullParserException, IOException, FHIRFormatError {
899      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionId")) {
900        res.setVersionIdElement(parseId(xpp));
901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastUpdated")) {
902        res.setLastUpdatedElement(parseInstant(xpp));
903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
904        res.getProfile().add(parseUri(xpp));
905      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
906        res.getSecurity().add(parseCoding(xpp));
907      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("tag")) {
908        res.getTag().add(parseCoding(xpp));
909      } else if (!parseElementContent(eventType, xpp, res))
910        return false;
911    return true;
912  }
913
914  protected Address parseAddress(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
915    Address res = new Address();
916    parseElementAttributes(xpp, res);
917    next(xpp);
918    int eventType = nextNoWhitespace(xpp);
919    while (eventType != XmlPullParser.END_TAG) {
920  if (!parseAddressContent(eventType, xpp, res))
921        unknownContent(xpp);
922      eventType = nextNoWhitespace(xpp);
923    }
924    next(xpp);
925    parseElementClose(res);
926    return res;
927  }
928
929  protected boolean parseAddressContent(int eventType, XmlPullParser xpp, Address res) throws XmlPullParserException, IOException, FHIRFormatError {
930      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
931        res.setUseElement(parseEnumeration(xpp, Address.AddressUse.NULL, new Address.AddressUseEnumFactory()));
932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
933        res.setTypeElement(parseEnumeration(xpp, Address.AddressType.NULL, new Address.AddressTypeEnumFactory()));
934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
935        res.setTextElement(parseString(xpp));
936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("line")) {
937        res.getLine().add(parseString(xpp));
938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("city")) {
939        res.setCityElement(parseString(xpp));
940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("district")) {
941        res.setDistrictElement(parseString(xpp));
942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
943        res.setStateElement(parseString(xpp));
944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("postalCode")) {
945        res.setPostalCodeElement(parseString(xpp));
946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("country")) {
947        res.setCountryElement(parseString(xpp));
948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
949        res.setPeriod(parsePeriod(xpp));
950      } else if (!parseElementContent(eventType, xpp, res))
951        return false;
952    return true;
953  }
954
955  protected TriggerDefinition parseTriggerDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
956    TriggerDefinition res = new TriggerDefinition();
957    parseElementAttributes(xpp, res);
958    next(xpp);
959    int eventType = nextNoWhitespace(xpp);
960    while (eventType != XmlPullParser.END_TAG) {
961  if (!parseTriggerDefinitionContent(eventType, xpp, res))
962        unknownContent(xpp);
963      eventType = nextNoWhitespace(xpp);
964    }
965    next(xpp);
966    parseElementClose(res);
967    return res;
968  }
969
970  protected boolean parseTriggerDefinitionContent(int eventType, XmlPullParser xpp, TriggerDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
971      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
972        res.setTypeElement(parseEnumeration(xpp, TriggerDefinition.TriggerType.NULL, new TriggerDefinition.TriggerTypeEnumFactory()));
973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventName")) {
974        res.setEventNameElement(parseString(xpp));
975      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "eventTiming")) {
976        res.setEventTiming(parseType("eventTiming", xpp));
977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventData")) {
978        res.setEventData(parseDataRequirement(xpp));
979      } else if (!parseElementContent(eventType, xpp, res))
980        return false;
981    return true;
982  }
983
984  protected Contributor parseContributor(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
985    Contributor res = new Contributor();
986    parseElementAttributes(xpp, res);
987    next(xpp);
988    int eventType = nextNoWhitespace(xpp);
989    while (eventType != XmlPullParser.END_TAG) {
990  if (!parseContributorContent(eventType, xpp, res))
991        unknownContent(xpp);
992      eventType = nextNoWhitespace(xpp);
993    }
994    next(xpp);
995    parseElementClose(res);
996    return res;
997  }
998
999  protected boolean parseContributorContent(int eventType, XmlPullParser xpp, Contributor res) throws XmlPullParserException, IOException, FHIRFormatError {
1000      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1001        res.setTypeElement(parseEnumeration(xpp, Contributor.ContributorType.NULL, new Contributor.ContributorTypeEnumFactory()));
1002      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1003        res.setNameElement(parseString(xpp));
1004      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1005        res.getContact().add(parseContactDetail(xpp));
1006      } else if (!parseElementContent(eventType, xpp, res))
1007        return false;
1008    return true;
1009  }
1010
1011  protected DataRequirement parseDataRequirement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1012    DataRequirement res = new DataRequirement();
1013    parseElementAttributes(xpp, res);
1014    next(xpp);
1015    int eventType = nextNoWhitespace(xpp);
1016    while (eventType != XmlPullParser.END_TAG) {
1017  if (!parseDataRequirementContent(eventType, xpp, res))
1018        unknownContent(xpp);
1019      eventType = nextNoWhitespace(xpp);
1020    }
1021    next(xpp);
1022    parseElementClose(res);
1023    return res;
1024  }
1025
1026  protected boolean parseDataRequirementContent(int eventType, XmlPullParser xpp, DataRequirement res) throws XmlPullParserException, IOException, FHIRFormatError {
1027      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1028        res.setTypeElement(parseCode(xpp));
1029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1030        res.getProfile().add(parseUri(xpp));
1031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1032        res.getMustSupport().add(parseString(xpp));
1033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codeFilter")) {
1034        res.getCodeFilter().add(parseDataRequirementDataRequirementCodeFilterComponent(xpp, res));
1035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateFilter")) {
1036        res.getDateFilter().add(parseDataRequirementDataRequirementDateFilterComponent(xpp, res));
1037      } else if (!parseElementContent(eventType, xpp, res))
1038        return false;
1039    return true;
1040  }
1041
1042  protected DataRequirement.DataRequirementCodeFilterComponent parseDataRequirementDataRequirementCodeFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1043    DataRequirement.DataRequirementCodeFilterComponent res = new DataRequirement.DataRequirementCodeFilterComponent();
1044    parseElementAttributes(xpp, res);
1045    next(xpp);
1046    int eventType = nextNoWhitespace(xpp);
1047    while (eventType != XmlPullParser.END_TAG) {
1048  if (!parseDataRequirementDataRequirementCodeFilterComponentContent(eventType, xpp, owner, res))
1049        unknownContent(xpp);
1050      eventType = nextNoWhitespace(xpp);
1051    }
1052    next(xpp);
1053    parseElementClose(res);
1054    return res;
1055  }
1056
1057  protected boolean parseDataRequirementDataRequirementCodeFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementCodeFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1058      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1059        res.setPathElement(parseString(xpp));
1060      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1061        res.setValueSet(parseType("valueSet", xpp));
1062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCode")) {
1063        res.getValueCode().add(parseCode(xpp));
1064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCoding")) {
1065        res.getValueCoding().add(parseCoding(xpp));
1066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueCodeableConcept")) {
1067        res.getValueCodeableConcept().add(parseCodeableConcept(xpp));
1068      } else if (!parseElementContent(eventType, xpp, res))
1069        return false;
1070    return true;
1071  }
1072
1073  protected DataRequirement.DataRequirementDateFilterComponent parseDataRequirementDataRequirementDateFilterComponent(XmlPullParser xpp, DataRequirement owner) throws XmlPullParserException, IOException, FHIRFormatError {
1074    DataRequirement.DataRequirementDateFilterComponent res = new DataRequirement.DataRequirementDateFilterComponent();
1075    parseElementAttributes(xpp, res);
1076    next(xpp);
1077    int eventType = nextNoWhitespace(xpp);
1078    while (eventType != XmlPullParser.END_TAG) {
1079  if (!parseDataRequirementDataRequirementDateFilterComponentContent(eventType, xpp, owner, res))
1080        unknownContent(xpp);
1081      eventType = nextNoWhitespace(xpp);
1082    }
1083    next(xpp);
1084    parseElementClose(res);
1085    return res;
1086  }
1087
1088  protected boolean parseDataRequirementDataRequirementDateFilterComponentContent(int eventType, XmlPullParser xpp, DataRequirement owner, DataRequirement.DataRequirementDateFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1089      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1090        res.setPathElement(parseString(xpp));
1091      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1092        res.setValue(parseType("value", xpp));
1093      } else if (!parseElementContent(eventType, xpp, res))
1094        return false;
1095    return true;
1096  }
1097
1098  protected Dosage parseDosage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1099    Dosage res = new Dosage();
1100    parseElementAttributes(xpp, res);
1101    next(xpp);
1102    int eventType = nextNoWhitespace(xpp);
1103    while (eventType != XmlPullParser.END_TAG) {
1104  if (!parseDosageContent(eventType, xpp, res))
1105        unknownContent(xpp);
1106      eventType = nextNoWhitespace(xpp);
1107    }
1108    next(xpp);
1109    parseElementClose(res);
1110    return res;
1111  }
1112
1113  protected boolean parseDosageContent(int eventType, XmlPullParser xpp, Dosage res) throws XmlPullParserException, IOException, FHIRFormatError {
1114      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
1115        res.setSequenceElement(parseInteger(xpp));
1116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1117        res.setTextElement(parseString(xpp));
1118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("additionalInstruction")) {
1119        res.getAdditionalInstruction().add(parseCodeableConcept(xpp));
1120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patientInstruction")) {
1121        res.setPatientInstructionElement(parseString(xpp));
1122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timing")) {
1123        res.setTiming(parseTiming(xpp));
1124      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "asNeeded")) {
1125        res.setAsNeeded(parseType("asNeeded", xpp));
1126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
1127        res.setSite(parseCodeableConcept(xpp));
1128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("route")) {
1129        res.setRoute(parseCodeableConcept(xpp));
1130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
1131        res.setMethod(parseCodeableConcept(xpp));
1132      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "dose")) {
1133        res.setDose(parseType("dose", xpp));
1134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerPeriod")) {
1135        res.setMaxDosePerPeriod(parseRatio(xpp));
1136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerAdministration")) {
1137        res.setMaxDosePerAdministration(parseSimpleQuantity(xpp));
1138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxDosePerLifetime")) {
1139        res.setMaxDosePerLifetime(parseSimpleQuantity(xpp));
1140      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "rate")) {
1141        res.setRate(parseType("rate", xpp));
1142      } else if (!parseElementContent(eventType, xpp, res))
1143        return false;
1144    return true;
1145  }
1146
1147  protected RelatedArtifact parseRelatedArtifact(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1148    RelatedArtifact res = new RelatedArtifact();
1149    parseElementAttributes(xpp, res);
1150    next(xpp);
1151    int eventType = nextNoWhitespace(xpp);
1152    while (eventType != XmlPullParser.END_TAG) {
1153  if (!parseRelatedArtifactContent(eventType, xpp, res))
1154        unknownContent(xpp);
1155      eventType = nextNoWhitespace(xpp);
1156    }
1157    next(xpp);
1158    parseElementClose(res);
1159    return res;
1160  }
1161
1162  protected boolean parseRelatedArtifactContent(int eventType, XmlPullParser xpp, RelatedArtifact res) throws XmlPullParserException, IOException, FHIRFormatError {
1163      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1164        res.setTypeElement(parseEnumeration(xpp, RelatedArtifact.RelatedArtifactType.NULL, new RelatedArtifact.RelatedArtifactTypeEnumFactory()));
1165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
1166        res.setDisplayElement(parseString(xpp));
1167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("citation")) {
1168        res.setCitationElement(parseString(xpp));
1169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1170        res.setUrlElement(parseUri(xpp));
1171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
1172        res.setDocument(parseAttachment(xpp));
1173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1174        res.setResource(parseReference(xpp));
1175      } else if (!parseElementContent(eventType, xpp, res))
1176        return false;
1177    return true;
1178  }
1179
1180  protected ContactDetail parseContactDetail(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1181    ContactDetail res = new ContactDetail();
1182    parseElementAttributes(xpp, res);
1183    next(xpp);
1184    int eventType = nextNoWhitespace(xpp);
1185    while (eventType != XmlPullParser.END_TAG) {
1186  if (!parseContactDetailContent(eventType, xpp, res))
1187        unknownContent(xpp);
1188      eventType = nextNoWhitespace(xpp);
1189    }
1190    next(xpp);
1191    parseElementClose(res);
1192    return res;
1193  }
1194
1195  protected boolean parseContactDetailContent(int eventType, XmlPullParser xpp, ContactDetail res) throws XmlPullParserException, IOException, FHIRFormatError {
1196      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1197        res.setNameElement(parseString(xpp));
1198      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("telecom")) {
1199        res.getTelecom().add(parseContactPoint(xpp));
1200      } else if (!parseElementContent(eventType, xpp, res))
1201        return false;
1202    return true;
1203  }
1204
1205  protected HumanName parseHumanName(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1206    HumanName res = new HumanName();
1207    parseElementAttributes(xpp, res);
1208    next(xpp);
1209    int eventType = nextNoWhitespace(xpp);
1210    while (eventType != XmlPullParser.END_TAG) {
1211  if (!parseHumanNameContent(eventType, xpp, res))
1212        unknownContent(xpp);
1213      eventType = nextNoWhitespace(xpp);
1214    }
1215    next(xpp);
1216    parseElementClose(res);
1217    return res;
1218  }
1219
1220  protected boolean parseHumanNameContent(int eventType, XmlPullParser xpp, HumanName res) throws XmlPullParserException, IOException, FHIRFormatError {
1221      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1222        res.setUseElement(parseEnumeration(xpp, HumanName.NameUse.NULL, new HumanName.NameUseEnumFactory()));
1223      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1224        res.setTextElement(parseString(xpp));
1225      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("family")) {
1226        res.setFamilyElement(parseString(xpp));
1227      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("given")) {
1228        res.getGiven().add(parseString(xpp));
1229      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prefix")) {
1230        res.getPrefix().add(parseString(xpp));
1231      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suffix")) {
1232        res.getSuffix().add(parseString(xpp));
1233      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1234        res.setPeriod(parsePeriod(xpp));
1235      } else if (!parseElementContent(eventType, xpp, res))
1236        return false;
1237    return true;
1238  }
1239
1240  protected ContactPoint parseContactPoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1241    ContactPoint res = new ContactPoint();
1242    parseElementAttributes(xpp, res);
1243    next(xpp);
1244    int eventType = nextNoWhitespace(xpp);
1245    while (eventType != XmlPullParser.END_TAG) {
1246  if (!parseContactPointContent(eventType, xpp, res))
1247        unknownContent(xpp);
1248      eventType = nextNoWhitespace(xpp);
1249    }
1250    next(xpp);
1251    parseElementClose(res);
1252    return res;
1253  }
1254
1255  protected boolean parseContactPointContent(int eventType, XmlPullParser xpp, ContactPoint res) throws XmlPullParserException, IOException, FHIRFormatError {
1256      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
1257        res.setSystemElement(parseEnumeration(xpp, ContactPoint.ContactPointSystem.NULL, new ContactPoint.ContactPointSystemEnumFactory()));
1258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
1259        res.setValueElement(parseString(xpp));
1260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1261        res.setUseElement(parseEnumeration(xpp, ContactPoint.ContactPointUse.NULL, new ContactPoint.ContactPointUseEnumFactory()));
1262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
1263        res.setRankElement(parsePositiveInt(xpp));
1264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1265        res.setPeriod(parsePeriod(xpp));
1266      } else if (!parseElementContent(eventType, xpp, res))
1267        return false;
1268    return true;
1269  }
1270
1271  protected UsageContext parseUsageContext(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1272    UsageContext res = new UsageContext();
1273    parseElementAttributes(xpp, res);
1274    next(xpp);
1275    int eventType = nextNoWhitespace(xpp);
1276    while (eventType != XmlPullParser.END_TAG) {
1277  if (!parseUsageContextContent(eventType, xpp, res))
1278        unknownContent(xpp);
1279      eventType = nextNoWhitespace(xpp);
1280    }
1281    next(xpp);
1282    parseElementClose(res);
1283    return res;
1284  }
1285
1286  protected boolean parseUsageContextContent(int eventType, XmlPullParser xpp, UsageContext res) throws XmlPullParserException, IOException, FHIRFormatError {
1287      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1288        res.setCode(parseCoding(xpp));
1289      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1290        res.setValue(parseType("value", xpp));
1291      } else if (!parseElementContent(eventType, xpp, res))
1292        return false;
1293    return true;
1294  }
1295
1296  protected Timing parseTiming(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1297    Timing res = new Timing();
1298    parseElementAttributes(xpp, res);
1299    next(xpp);
1300    int eventType = nextNoWhitespace(xpp);
1301    while (eventType != XmlPullParser.END_TAG) {
1302  if (!parseTimingContent(eventType, xpp, res))
1303        unknownContent(xpp);
1304      eventType = nextNoWhitespace(xpp);
1305    }
1306    next(xpp);
1307    parseElementClose(res);
1308    return res;
1309  }
1310
1311  protected boolean parseTimingContent(int eventType, XmlPullParser xpp, Timing res) throws XmlPullParserException, IOException, FHIRFormatError {
1312      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
1313        res.getEvent().add(parseDateTime(xpp));
1314      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("repeat")) {
1315        res.setRepeat(parseTimingTimingRepeatComponent(xpp, res));
1316      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1317        res.setCode(parseCodeableConcept(xpp));
1318      } else if (!parseElementContent(eventType, xpp, res))
1319        return false;
1320    return true;
1321  }
1322
1323  protected Timing.TimingRepeatComponent parseTimingTimingRepeatComponent(XmlPullParser xpp, Timing owner) throws XmlPullParserException, IOException, FHIRFormatError {
1324    Timing.TimingRepeatComponent res = new Timing.TimingRepeatComponent();
1325    parseElementAttributes(xpp, res);
1326    next(xpp);
1327    int eventType = nextNoWhitespace(xpp);
1328    while (eventType != XmlPullParser.END_TAG) {
1329  if (!parseTimingTimingRepeatComponentContent(eventType, xpp, owner, res))
1330        unknownContent(xpp);
1331      eventType = nextNoWhitespace(xpp);
1332    }
1333    next(xpp);
1334    parseElementClose(res);
1335    return res;
1336  }
1337
1338  protected boolean parseTimingTimingRepeatComponentContent(int eventType, XmlPullParser xpp, Timing owner, Timing.TimingRepeatComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1339      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "bounds")) {
1340        res.setBounds(parseType("bounds", xpp));
1341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
1342        res.setCountElement(parseInteger(xpp));
1343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("countMax")) {
1344        res.setCountMaxElement(parseInteger(xpp));
1345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("duration")) {
1346        res.setDurationElement(parseDecimal(xpp));
1347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationMax")) {
1348        res.setDurationMaxElement(parseDecimal(xpp));
1349      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("durationUnit")) {
1350        res.setDurationUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1351      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequency")) {
1352        res.setFrequencyElement(parseInteger(xpp));
1353      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("frequencyMax")) {
1354        res.setFrequencyMaxElement(parseInteger(xpp));
1355      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1356        res.setPeriodElement(parseDecimal(xpp));
1357      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodMax")) {
1358        res.setPeriodMaxElement(parseDecimal(xpp));
1359      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("periodUnit")) {
1360        res.setPeriodUnitElement(parseEnumeration(xpp, Timing.UnitsOfTime.NULL, new Timing.UnitsOfTimeEnumFactory()));
1361      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dayOfWeek")) {
1362        res.getDayOfWeek().add(parseEnumeration(xpp, Timing.DayOfWeek.NULL, new Timing.DayOfWeekEnumFactory()));
1363      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("timeOfDay")) {
1364        res.getTimeOfDay().add(parseTime(xpp));
1365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("when")) {
1366        res.getWhen().add(parseEnumeration(xpp, Timing.EventTiming.NULL, new Timing.EventTimingEnumFactory()));
1367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("offset")) {
1368        res.setOffsetElement(parseUnsignedInt(xpp));
1369      } else if (!parseElementContent(eventType, xpp, res))
1370        return false;
1371    return true;
1372  }
1373
1374  protected ElementDefinition parseElementDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1375    ElementDefinition res = new ElementDefinition();
1376    parseElementAttributes(xpp, res);
1377    next(xpp);
1378    int eventType = nextNoWhitespace(xpp);
1379    while (eventType != XmlPullParser.END_TAG) {
1380  if (!parseElementDefinitionContent(eventType, xpp, res))
1381        unknownContent(xpp);
1382      eventType = nextNoWhitespace(xpp);
1383    }
1384    next(xpp);
1385    parseElementClose(res);
1386    return res;
1387  }
1388
1389  protected boolean parseElementDefinitionContent(int eventType, XmlPullParser xpp, ElementDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1390      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1391        res.setPathElement(parseString(xpp));
1392      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("representation")) {
1393        res.getRepresentation().add(parseEnumeration(xpp, ElementDefinition.PropertyRepresentation.NULL, new ElementDefinition.PropertyRepresentationEnumFactory()));
1394      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sliceName")) {
1395        res.setSliceNameElement(parseString(xpp));
1396      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1397        res.setLabelElement(parseString(xpp));
1398      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1399        res.getCode().add(parseCoding(xpp));
1400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slicing")) {
1401        res.setSlicing(parseElementDefinitionElementDefinitionSlicingComponent(xpp, res));
1402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("short")) {
1403        res.setShortElement(parseString(xpp));
1404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
1405        res.setDefinitionElement(parseMarkdown(xpp));
1406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1407        res.setCommentElement(parseMarkdown(xpp));
1408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1409        res.setRequirementsElement(parseMarkdown(xpp));
1410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("alias")) {
1411        res.getAlias().add(parseString(xpp));
1412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1413        res.setMinElement(parseUnsignedInt(xpp));
1414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1415        res.setMaxElement(parseString(xpp));
1416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("base")) {
1417        res.setBase(parseElementDefinitionElementDefinitionBaseComponent(xpp, res));
1418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentReference")) {
1419        res.setContentReferenceElement(parseUri(xpp));
1420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1421        res.getType().add(parseElementDefinitionTypeRefComponent(xpp, res));
1422      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "defaultValue")) {
1423        res.setDefaultValue(parseType("defaultValue", xpp));
1424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaningWhenMissing")) {
1425        res.setMeaningWhenMissingElement(parseMarkdown(xpp));
1426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderMeaning")) {
1427        res.setOrderMeaningElement(parseString(xpp));
1428      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "fixed")) {
1429        res.setFixed(parseType("fixed", xpp));
1430      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "pattern")) {
1431        res.setPattern(parseType("pattern", xpp));
1432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("example")) {
1433        res.getExample().add(parseElementDefinitionElementDefinitionExampleComponent(xpp, res));
1434      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "minValue")) {
1435        res.setMinValue(parseType("minValue", xpp));
1436      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "maxValue")) {
1437        res.setMaxValue(parseType("maxValue", xpp));
1438      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("maxLength")) {
1439        res.setMaxLengthElement(parseInteger(xpp));
1440      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
1441        res.getCondition().add(parseId(xpp));
1442      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("constraint")) {
1443        res.getConstraint().add(parseElementDefinitionElementDefinitionConstraintComponent(xpp, res));
1444      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mustSupport")) {
1445        res.setMustSupportElement(parseBoolean(xpp));
1446      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isModifier")) {
1447        res.setIsModifierElement(parseBoolean(xpp));
1448      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("isSummary")) {
1449        res.setIsSummaryElement(parseBoolean(xpp));
1450      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("binding")) {
1451        res.setBinding(parseElementDefinitionElementDefinitionBindingComponent(xpp, res));
1452      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
1453        res.getMapping().add(parseElementDefinitionElementDefinitionMappingComponent(xpp, res));
1454      } else if (!parseElementContent(eventType, xpp, res))
1455        return false;
1456    return true;
1457  }
1458
1459  protected ElementDefinition.ElementDefinitionSlicingComponent parseElementDefinitionElementDefinitionSlicingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1460    ElementDefinition.ElementDefinitionSlicingComponent res = new ElementDefinition.ElementDefinitionSlicingComponent();
1461    parseElementAttributes(xpp, res);
1462    next(xpp);
1463    int eventType = nextNoWhitespace(xpp);
1464    while (eventType != XmlPullParser.END_TAG) {
1465  if (!parseElementDefinitionElementDefinitionSlicingComponentContent(eventType, xpp, owner, res))
1466        unknownContent(xpp);
1467      eventType = nextNoWhitespace(xpp);
1468    }
1469    next(xpp);
1470    parseElementClose(res);
1471    return res;
1472  }
1473
1474  protected boolean parseElementDefinitionElementDefinitionSlicingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1475      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("discriminator")) {
1476        res.getDiscriminator().add(parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(xpp, owner));
1477      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1478        res.setDescriptionElement(parseString(xpp));
1479      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ordered")) {
1480        res.setOrderedElement(parseBoolean(xpp));
1481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rules")) {
1482        res.setRulesElement(parseEnumeration(xpp, ElementDefinition.SlicingRules.NULL, new ElementDefinition.SlicingRulesEnumFactory()));
1483      } else if (!parseElementContent(eventType, xpp, res))
1484        return false;
1485    return true;
1486  }
1487
1488  protected ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent parseElementDefinitionElementDefinitionSlicingDiscriminatorComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1489    ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res = new ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent();
1490    parseElementAttributes(xpp, res);
1491    next(xpp);
1492    int eventType = nextNoWhitespace(xpp);
1493    while (eventType != XmlPullParser.END_TAG) {
1494  if (!parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(eventType, xpp, owner, res))
1495        unknownContent(xpp);
1496      eventType = nextNoWhitespace(xpp);
1497    }
1498    next(xpp);
1499    parseElementClose(res);
1500    return res;
1501  }
1502
1503  protected boolean parseElementDefinitionElementDefinitionSlicingDiscriminatorComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1504      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1505        res.setTypeElement(parseEnumeration(xpp, ElementDefinition.DiscriminatorType.NULL, new ElementDefinition.DiscriminatorTypeEnumFactory()));
1506      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1507        res.setPathElement(parseString(xpp));
1508      } else if (!parseElementContent(eventType, xpp, res))
1509        return false;
1510    return true;
1511  }
1512
1513  protected ElementDefinition.ElementDefinitionBaseComponent parseElementDefinitionElementDefinitionBaseComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1514    ElementDefinition.ElementDefinitionBaseComponent res = new ElementDefinition.ElementDefinitionBaseComponent();
1515    parseElementAttributes(xpp, res);
1516    next(xpp);
1517    int eventType = nextNoWhitespace(xpp);
1518    while (eventType != XmlPullParser.END_TAG) {
1519  if (!parseElementDefinitionElementDefinitionBaseComponentContent(eventType, xpp, owner, res))
1520        unknownContent(xpp);
1521      eventType = nextNoWhitespace(xpp);
1522    }
1523    next(xpp);
1524    parseElementClose(res);
1525    return res;
1526  }
1527
1528  protected boolean parseElementDefinitionElementDefinitionBaseComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBaseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1529      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
1530        res.setPathElement(parseString(xpp));
1531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1532        res.setMinElement(parseUnsignedInt(xpp));
1533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1534        res.setMaxElement(parseString(xpp));
1535      } else if (!parseElementContent(eventType, xpp, res))
1536        return false;
1537    return true;
1538  }
1539
1540  protected ElementDefinition.TypeRefComponent parseElementDefinitionTypeRefComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1541    ElementDefinition.TypeRefComponent res = new ElementDefinition.TypeRefComponent();
1542    parseElementAttributes(xpp, res);
1543    next(xpp);
1544    int eventType = nextNoWhitespace(xpp);
1545    while (eventType != XmlPullParser.END_TAG) {
1546  if (!parseElementDefinitionTypeRefComponentContent(eventType, xpp, owner, res))
1547        unknownContent(xpp);
1548      eventType = nextNoWhitespace(xpp);
1549    }
1550    next(xpp);
1551    parseElementClose(res);
1552    return res;
1553  }
1554
1555  protected boolean parseElementDefinitionTypeRefComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.TypeRefComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1556      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1557        res.setCodeElement(parseUri(xpp));
1558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1559        res.setProfileElement(parseUri(xpp));
1560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetProfile")) {
1561        res.setTargetProfileElement(parseUri(xpp));
1562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("aggregation")) {
1563        res.getAggregation().add(parseEnumeration(xpp, ElementDefinition.AggregationMode.NULL, new ElementDefinition.AggregationModeEnumFactory()));
1564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
1565        res.setVersioningElement(parseEnumeration(xpp, ElementDefinition.ReferenceVersionRules.NULL, new ElementDefinition.ReferenceVersionRulesEnumFactory()));
1566      } else if (!parseElementContent(eventType, xpp, res))
1567        return false;
1568    return true;
1569  }
1570
1571  protected ElementDefinition.ElementDefinitionExampleComponent parseElementDefinitionElementDefinitionExampleComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1572    ElementDefinition.ElementDefinitionExampleComponent res = new ElementDefinition.ElementDefinitionExampleComponent();
1573    parseElementAttributes(xpp, res);
1574    next(xpp);
1575    int eventType = nextNoWhitespace(xpp);
1576    while (eventType != XmlPullParser.END_TAG) {
1577  if (!parseElementDefinitionElementDefinitionExampleComponentContent(eventType, xpp, owner, res))
1578        unknownContent(xpp);
1579      eventType = nextNoWhitespace(xpp);
1580    }
1581    next(xpp);
1582    parseElementClose(res);
1583    return res;
1584  }
1585
1586  protected boolean parseElementDefinitionElementDefinitionExampleComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionExampleComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1587      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("label")) {
1588        res.setLabelElement(parseString(xpp));
1589      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1590        res.setValue(parseType("value", xpp));
1591      } else if (!parseElementContent(eventType, xpp, res))
1592        return false;
1593    return true;
1594  }
1595
1596  protected ElementDefinition.ElementDefinitionConstraintComponent parseElementDefinitionElementDefinitionConstraintComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1597    ElementDefinition.ElementDefinitionConstraintComponent res = new ElementDefinition.ElementDefinitionConstraintComponent();
1598    parseElementAttributes(xpp, res);
1599    next(xpp);
1600    int eventType = nextNoWhitespace(xpp);
1601    while (eventType != XmlPullParser.END_TAG) {
1602  if (!parseElementDefinitionElementDefinitionConstraintComponentContent(eventType, xpp, owner, res))
1603        unknownContent(xpp);
1604      eventType = nextNoWhitespace(xpp);
1605    }
1606    next(xpp);
1607    parseElementClose(res);
1608    return res;
1609  }
1610
1611  protected boolean parseElementDefinitionElementDefinitionConstraintComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionConstraintComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1612      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("key")) {
1613        res.setKeyElement(parseId(xpp));
1614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requirements")) {
1615        res.setRequirementsElement(parseString(xpp));
1616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
1617        res.setSeverityElement(parseEnumeration(xpp, ElementDefinition.ConstraintSeverity.NULL, new ElementDefinition.ConstraintSeverityEnumFactory()));
1618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("human")) {
1619        res.setHumanElement(parseString(xpp));
1620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
1621        res.setExpressionElement(parseString(xpp));
1622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("xpath")) {
1623        res.setXpathElement(parseString(xpp));
1624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
1625        res.setSourceElement(parseUri(xpp));
1626      } else if (!parseElementContent(eventType, xpp, res))
1627        return false;
1628    return true;
1629  }
1630
1631  protected ElementDefinition.ElementDefinitionBindingComponent parseElementDefinitionElementDefinitionBindingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1632    ElementDefinition.ElementDefinitionBindingComponent res = new ElementDefinition.ElementDefinitionBindingComponent();
1633    parseElementAttributes(xpp, res);
1634    next(xpp);
1635    int eventType = nextNoWhitespace(xpp);
1636    while (eventType != XmlPullParser.END_TAG) {
1637  if (!parseElementDefinitionElementDefinitionBindingComponentContent(eventType, xpp, owner, res))
1638        unknownContent(xpp);
1639      eventType = nextNoWhitespace(xpp);
1640    }
1641    next(xpp);
1642    parseElementClose(res);
1643    return res;
1644  }
1645
1646  protected boolean parseElementDefinitionElementDefinitionBindingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionBindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1647      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("strength")) {
1648        res.setStrengthElement(parseEnumeration(xpp, Enumerations.BindingStrength.NULL, new Enumerations.BindingStrengthEnumFactory()));
1649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1650        res.setDescriptionElement(parseString(xpp));
1651      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "valueSet")) {
1652        res.setValueSet(parseType("valueSet", xpp));
1653      } else if (!parseElementContent(eventType, xpp, res))
1654        return false;
1655    return true;
1656  }
1657
1658  protected ElementDefinition.ElementDefinitionMappingComponent parseElementDefinitionElementDefinitionMappingComponent(XmlPullParser xpp, ElementDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
1659    ElementDefinition.ElementDefinitionMappingComponent res = new ElementDefinition.ElementDefinitionMappingComponent();
1660    parseElementAttributes(xpp, res);
1661    next(xpp);
1662    int eventType = nextNoWhitespace(xpp);
1663    while (eventType != XmlPullParser.END_TAG) {
1664  if (!parseElementDefinitionElementDefinitionMappingComponentContent(eventType, xpp, owner, res))
1665        unknownContent(xpp);
1666      eventType = nextNoWhitespace(xpp);
1667    }
1668    next(xpp);
1669    parseElementClose(res);
1670    return res;
1671  }
1672
1673  protected boolean parseElementDefinitionElementDefinitionMappingComponentContent(int eventType, XmlPullParser xpp, ElementDefinition owner, ElementDefinition.ElementDefinitionMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1674      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
1675        res.setIdentityElement(parseId(xpp));
1676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1677        res.setLanguageElement(parseCode(xpp));
1678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("map")) {
1679        res.setMapElement(parseString(xpp));
1680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
1681        res.setCommentElement(parseString(xpp));
1682      } else if (!parseElementContent(eventType, xpp, res))
1683        return false;
1684    return true;
1685  }
1686
1687  protected ParameterDefinition parseParameterDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1688    ParameterDefinition res = new ParameterDefinition();
1689    parseElementAttributes(xpp, res);
1690    next(xpp);
1691    int eventType = nextNoWhitespace(xpp);
1692    while (eventType != XmlPullParser.END_TAG) {
1693  if (!parseParameterDefinitionContent(eventType, xpp, res))
1694        unknownContent(xpp);
1695      eventType = nextNoWhitespace(xpp);
1696    }
1697    next(xpp);
1698    parseElementClose(res);
1699    return res;
1700  }
1701
1702  protected boolean parseParameterDefinitionContent(int eventType, XmlPullParser xpp, ParameterDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1703      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1704        res.setNameElement(parseCode(xpp));
1705      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
1706        res.setUseElement(parseEnumeration(xpp, ParameterDefinition.ParameterUse.NULL, new ParameterDefinition.ParameterUseEnumFactory()));
1707      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("min")) {
1708        res.setMinElement(parseInteger(xpp));
1709      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("max")) {
1710        res.setMaxElement(parseString(xpp));
1711      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
1712        res.setDocumentationElement(parseString(xpp));
1713      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1714        res.setTypeElement(parseCode(xpp));
1715      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
1716        res.setProfile(parseReference(xpp));
1717      } else if (!parseElementContent(eventType, xpp, res))
1718        return false;
1719    return true;
1720  }
1721
1722  protected void parseDomainResourceAttributes(XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1723    parseResourceAttributes(xpp, res);
1724  }
1725
1726  protected boolean parseDomainResourceContent(int eventType, XmlPullParser xpp, DomainResource res) throws XmlPullParserException, IOException, FHIRFormatError {
1727      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
1728        res.setText(parseNarrative(xpp));
1729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contained")) {
1730        res.getContained().add(parseResourceContained(xpp));
1731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("extension")) {
1732        res.getExtension().add(parseExtension(xpp));
1733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifierExtension")) {
1734        res.getModifierExtension().add(parseExtension(xpp));
1735    } else
1736    return parseResourceContent(eventType, xpp, res);
1737    return true;
1738  }
1739
1740  protected Parameters parseParameters(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1741    Parameters res = new Parameters();
1742    parseResourceAttributes(xpp, res);
1743    next(xpp);
1744    int eventType = nextNoWhitespace(xpp);
1745    while (eventType != XmlPullParser.END_TAG) {
1746  if (!parseParametersContent(eventType, xpp, res))
1747        unknownContent(xpp);
1748      eventType = nextNoWhitespace(xpp);
1749    }
1750    next(xpp);
1751    parseElementClose(res);
1752    return res;
1753  }
1754
1755  protected boolean parseParametersContent(int eventType, XmlPullParser xpp, Parameters res) throws XmlPullParserException, IOException, FHIRFormatError {
1756      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameter")) {
1757        res.getParameter().add(parseParametersParametersParameterComponent(xpp, res));
1758      } else if (!parseResourceContent(eventType, xpp, res))
1759        return false;
1760    return true;
1761  }
1762
1763  protected Parameters.ParametersParameterComponent parseParametersParametersParameterComponent(XmlPullParser xpp, Parameters owner) throws XmlPullParserException, IOException, FHIRFormatError {
1764    Parameters.ParametersParameterComponent res = new Parameters.ParametersParameterComponent();
1765    parseBackboneAttributes(xpp, res);
1766    next(xpp);
1767    int eventType = nextNoWhitespace(xpp);
1768    while (eventType != XmlPullParser.END_TAG) {
1769  if (!parseParametersParametersParameterComponentContent(eventType, xpp, owner, res))
1770        unknownContent(xpp);
1771      eventType = nextNoWhitespace(xpp);
1772    }
1773    next(xpp);
1774    parseElementClose(res);
1775    return res;
1776  }
1777
1778  protected boolean parseParametersParametersParameterComponentContent(int eventType, XmlPullParser xpp, Parameters owner, Parameters.ParametersParameterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1779      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1780        res.setNameElement(parseString(xpp));
1781      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
1782        res.setValue(parseType("value", xpp));
1783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
1784        res.setResource(parseResourceContained(xpp));
1785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("part")) {
1786        res.getPart().add(parseParametersParametersParameterComponent(xpp, owner));
1787      } else if (!parseBackboneContent(eventType, xpp, res))
1788        return false;
1789    return true;
1790  }
1791
1792  protected void parseResourceAttributes(XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1793    if (!comments.isEmpty()) {
1794      res.getFormatCommentsPre().addAll(comments);
1795      comments.clear();
1796     }
1797  }
1798
1799  protected boolean parseResourceContent(int eventType, XmlPullParser xpp, Resource res) throws XmlPullParserException, IOException, FHIRFormatError {
1800      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("id")) {
1801        res.setIdElement(parseId(xpp));
1802      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meta")) {
1803        res.setMeta(parseMeta(xpp));
1804      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicitRules")) {
1805        res.setImplicitRulesElement(parseUri(xpp));
1806      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
1807        res.setLanguageElement(parseCode(xpp));
1808    } else
1809        return false;
1810    return true;
1811  }
1812
1813  protected Account parseAccount(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1814    Account res = new Account();
1815    parseDomainResourceAttributes(xpp, res);
1816    next(xpp);
1817    int eventType = nextNoWhitespace(xpp);
1818    while (eventType != XmlPullParser.END_TAG) {
1819  if (!parseAccountContent(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 parseAccountContent(int eventType, XmlPullParser xpp, Account res) throws XmlPullParserException, IOException, FHIRFormatError {
1829      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1830        res.getIdentifier().add(parseIdentifier(xpp));
1831      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1832        res.setStatusElement(parseEnumeration(xpp, Account.AccountStatus.NULL, new Account.AccountStatusEnumFactory()));
1833      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
1834        res.setType(parseCodeableConcept(xpp));
1835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1836        res.setNameElement(parseString(xpp));
1837      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
1838        res.setSubject(parseReference(xpp));
1839      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1840        res.setPeriod(parsePeriod(xpp));
1841      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
1842        res.setActive(parsePeriod(xpp));
1843      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("balance")) {
1844        res.setBalance(parseMoney(xpp));
1845      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1846        res.getCoverage().add(parseAccountCoverageComponent(xpp, res));
1847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
1848        res.setOwner(parseReference(xpp));
1849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1850        res.setDescriptionElement(parseString(xpp));
1851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("guarantor")) {
1852        res.getGuarantor().add(parseAccountGuarantorComponent(xpp, res));
1853      } else if (!parseDomainResourceContent(eventType, xpp, res))
1854        return false;
1855    return true;
1856  }
1857
1858  protected Account.CoverageComponent parseAccountCoverageComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1859    Account.CoverageComponent res = new Account.CoverageComponent();
1860    parseBackboneAttributes(xpp, res);
1861    next(xpp);
1862    int eventType = nextNoWhitespace(xpp);
1863    while (eventType != XmlPullParser.END_TAG) {
1864  if (!parseAccountCoverageComponentContent(eventType, xpp, owner, res))
1865        unknownContent(xpp);
1866      eventType = nextNoWhitespace(xpp);
1867    }
1868    next(xpp);
1869    parseElementClose(res);
1870    return res;
1871  }
1872
1873  protected boolean parseAccountCoverageComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.CoverageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1874      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
1875        res.setCoverage(parseReference(xpp));
1876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
1877        res.setPriorityElement(parsePositiveInt(xpp));
1878      } else if (!parseBackboneContent(eventType, xpp, res))
1879        return false;
1880    return true;
1881  }
1882
1883  protected Account.GuarantorComponent parseAccountGuarantorComponent(XmlPullParser xpp, Account owner) throws XmlPullParserException, IOException, FHIRFormatError {
1884    Account.GuarantorComponent res = new Account.GuarantorComponent();
1885    parseBackboneAttributes(xpp, res);
1886    next(xpp);
1887    int eventType = nextNoWhitespace(xpp);
1888    while (eventType != XmlPullParser.END_TAG) {
1889  if (!parseAccountGuarantorComponentContent(eventType, xpp, owner, res))
1890        unknownContent(xpp);
1891      eventType = nextNoWhitespace(xpp);
1892    }
1893    next(xpp);
1894    parseElementClose(res);
1895    return res;
1896  }
1897
1898  protected boolean parseAccountGuarantorComponentContent(int eventType, XmlPullParser xpp, Account owner, Account.GuarantorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
1899      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
1900        res.setParty(parseReference(xpp));
1901      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onHold")) {
1902        res.setOnHoldElement(parseBoolean(xpp));
1903      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
1904        res.setPeriod(parsePeriod(xpp));
1905      } else if (!parseBackboneContent(eventType, xpp, res))
1906        return false;
1907    return true;
1908  }
1909
1910  protected ActivityDefinition parseActivityDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
1911    ActivityDefinition res = new ActivityDefinition();
1912    parseDomainResourceAttributes(xpp, res);
1913    next(xpp);
1914    int eventType = nextNoWhitespace(xpp);
1915    while (eventType != XmlPullParser.END_TAG) {
1916  if (!parseActivityDefinitionContent(eventType, xpp, res))
1917        unknownContent(xpp);
1918      eventType = nextNoWhitespace(xpp);
1919    }
1920    next(xpp);
1921    parseElementClose(res);
1922    return res;
1923  }
1924
1925  protected boolean parseActivityDefinitionContent(int eventType, XmlPullParser xpp, ActivityDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
1926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
1927        res.setUrlElement(parseUri(xpp));
1928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
1929        res.getIdentifier().add(parseIdentifier(xpp));
1930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
1931        res.setVersionElement(parseString(xpp));
1932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
1933        res.setNameElement(parseString(xpp));
1934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
1935        res.setTitleElement(parseString(xpp));
1936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
1937        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
1938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
1939        res.setExperimentalElement(parseBoolean(xpp));
1940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
1941        res.setDateElement(parseDateTime(xpp));
1942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
1943        res.setPublisherElement(parseString(xpp));
1944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
1945        res.setDescriptionElement(parseMarkdown(xpp));
1946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
1947        res.setPurposeElement(parseMarkdown(xpp));
1948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("usage")) {
1949        res.setUsageElement(parseString(xpp));
1950      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("approvalDate")) {
1951        res.setApprovalDateElement(parseDate(xpp));
1952      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastReviewDate")) {
1953        res.setLastReviewDateElement(parseDate(xpp));
1954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectivePeriod")) {
1955        res.setEffectivePeriod(parsePeriod(xpp));
1956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
1957        res.getUseContext().add(parseUsageContext(xpp));
1958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
1959        res.getJurisdiction().add(parseCodeableConcept(xpp));
1960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
1961        res.getTopic().add(parseCodeableConcept(xpp));
1962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contributor")) {
1963        res.getContributor().add(parseContributor(xpp));
1964      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
1965        res.getContact().add(parseContactDetail(xpp));
1966      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
1967        res.setCopyrightElement(parseMarkdown(xpp));
1968      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatedArtifact")) {
1969        res.getRelatedArtifact().add(parseRelatedArtifact(xpp));
1970      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("library")) {
1971        res.getLibrary().add(parseReference(xpp));
1972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
1973        res.setKindElement(parseEnumeration(xpp, ActivityDefinition.ActivityDefinitionKind.NULL, new ActivityDefinition.ActivityDefinitionKindEnumFactory()));
1974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
1975        res.setCode(parseCodeableConcept(xpp));
1976      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
1977        res.setTiming(parseType("timing", xpp));
1978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
1979        res.setLocation(parseReference(xpp));
1980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
1981        res.getParticipant().add(parseActivityDefinitionActivityDefinitionParticipantComponent(xpp, res));
1982      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
1983        res.setProduct(parseType("product", xpp));
1984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
1985        res.setQuantity(parseSimpleQuantity(xpp));
1986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dosage")) {
1987        res.getDosage().add(parseDosage(xpp));
1988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
1989        res.getBodySite().add(parseCodeableConcept(xpp));
1990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("transform")) {
1991        res.setTransform(parseReference(xpp));
1992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dynamicValue")) {
1993        res.getDynamicValue().add(parseActivityDefinitionActivityDefinitionDynamicValueComponent(xpp, res));
1994      } else if (!parseDomainResourceContent(eventType, xpp, res))
1995        return false;
1996    return true;
1997  }
1998
1999  protected ActivityDefinition.ActivityDefinitionParticipantComponent parseActivityDefinitionActivityDefinitionParticipantComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2000    ActivityDefinition.ActivityDefinitionParticipantComponent res = new ActivityDefinition.ActivityDefinitionParticipantComponent();
2001    parseBackboneAttributes(xpp, res);
2002    next(xpp);
2003    int eventType = nextNoWhitespace(xpp);
2004    while (eventType != XmlPullParser.END_TAG) {
2005  if (!parseActivityDefinitionActivityDefinitionParticipantComponentContent(eventType, xpp, owner, res))
2006        unknownContent(xpp);
2007      eventType = nextNoWhitespace(xpp);
2008    }
2009    next(xpp);
2010    parseElementClose(res);
2011    return res;
2012  }
2013
2014  protected boolean parseActivityDefinitionActivityDefinitionParticipantComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2015      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2016        res.setTypeElement(parseEnumeration(xpp, ActivityDefinition.ActivityParticipantType.NULL, new ActivityDefinition.ActivityParticipantTypeEnumFactory()));
2017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2018        res.setRole(parseCodeableConcept(xpp));
2019      } else if (!parseBackboneContent(eventType, xpp, res))
2020        return false;
2021    return true;
2022  }
2023
2024  protected ActivityDefinition.ActivityDefinitionDynamicValueComponent parseActivityDefinitionActivityDefinitionDynamicValueComponent(XmlPullParser xpp, ActivityDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
2025    ActivityDefinition.ActivityDefinitionDynamicValueComponent res = new ActivityDefinition.ActivityDefinitionDynamicValueComponent();
2026    parseBackboneAttributes(xpp, res);
2027    next(xpp);
2028    int eventType = nextNoWhitespace(xpp);
2029    while (eventType != XmlPullParser.END_TAG) {
2030  if (!parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(eventType, xpp, owner, res))
2031        unknownContent(xpp);
2032      eventType = nextNoWhitespace(xpp);
2033    }
2034    next(xpp);
2035    parseElementClose(res);
2036    return res;
2037  }
2038
2039  protected boolean parseActivityDefinitionActivityDefinitionDynamicValueComponentContent(int eventType, XmlPullParser xpp, ActivityDefinition owner, ActivityDefinition.ActivityDefinitionDynamicValueComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2040      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2041        res.setDescriptionElement(parseString(xpp));
2042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("path")) {
2043        res.setPathElement(parseString(xpp));
2044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
2045        res.setLanguageElement(parseString(xpp));
2046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expression")) {
2047        res.setExpressionElement(parseString(xpp));
2048      } else if (!parseBackboneContent(eventType, xpp, res))
2049        return false;
2050    return true;
2051  }
2052
2053  protected AdverseEvent parseAdverseEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2054    AdverseEvent res = new AdverseEvent();
2055    parseDomainResourceAttributes(xpp, res);
2056    next(xpp);
2057    int eventType = nextNoWhitespace(xpp);
2058    while (eventType != XmlPullParser.END_TAG) {
2059  if (!parseAdverseEventContent(eventType, xpp, res))
2060        unknownContent(xpp);
2061      eventType = nextNoWhitespace(xpp);
2062    }
2063    next(xpp);
2064    parseElementClose(res);
2065    return res;
2066  }
2067
2068  protected boolean parseAdverseEventContent(int eventType, XmlPullParser xpp, AdverseEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2069      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2070        res.setIdentifier(parseIdentifier(xpp));
2071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2072        res.setCategoryElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCategory.NULL, new AdverseEvent.AdverseEventCategoryEnumFactory()));
2073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2074        res.setType(parseCodeableConcept(xpp));
2075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2076        res.setSubject(parseReference(xpp));
2077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2078        res.setDateElement(parseDateTime(xpp));
2079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2080        res.getReaction().add(parseReference(xpp));
2081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2082        res.setLocation(parseReference(xpp));
2083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("seriousness")) {
2084        res.setSeriousness(parseCodeableConcept(xpp));
2085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2086        res.setOutcome(parseCodeableConcept(xpp));
2087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2088        res.setRecorder(parseReference(xpp));
2089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("eventParticipant")) {
2090        res.setEventParticipant(parseReference(xpp));
2091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2092        res.setDescriptionElement(parseString(xpp));
2093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("suspectEntity")) {
2094        res.getSuspectEntity().add(parseAdverseEventAdverseEventSuspectEntityComponent(xpp, res));
2095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subjectMedicalHistory")) {
2096        res.getSubjectMedicalHistory().add(parseReference(xpp));
2097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referenceDocument")) {
2098        res.getReferenceDocument().add(parseReference(xpp));
2099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("study")) {
2100        res.getStudy().add(parseReference(xpp));
2101      } else if (!parseDomainResourceContent(eventType, xpp, res))
2102        return false;
2103    return true;
2104  }
2105
2106  protected AdverseEvent.AdverseEventSuspectEntityComponent parseAdverseEventAdverseEventSuspectEntityComponent(XmlPullParser xpp, AdverseEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2107    AdverseEvent.AdverseEventSuspectEntityComponent res = new AdverseEvent.AdverseEventSuspectEntityComponent();
2108    parseBackboneAttributes(xpp, res);
2109    next(xpp);
2110    int eventType = nextNoWhitespace(xpp);
2111    while (eventType != XmlPullParser.END_TAG) {
2112  if (!parseAdverseEventAdverseEventSuspectEntityComponentContent(eventType, xpp, owner, res))
2113        unknownContent(xpp);
2114      eventType = nextNoWhitespace(xpp);
2115    }
2116    next(xpp);
2117    parseElementClose(res);
2118    return res;
2119  }
2120
2121  protected boolean parseAdverseEventAdverseEventSuspectEntityComponentContent(int eventType, XmlPullParser xpp, AdverseEvent owner, AdverseEvent.AdverseEventSuspectEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2122      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instance")) {
2123        res.setInstance(parseReference(xpp));
2124      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causality")) {
2125        res.setCausalityElement(parseEnumeration(xpp, AdverseEvent.AdverseEventCausality.NULL, new AdverseEvent.AdverseEventCausalityEnumFactory()));
2126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAssessment")) {
2127        res.setCausalityAssessment(parseCodeableConcept(xpp));
2128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityProductRelatedness")) {
2129        res.setCausalityProductRelatednessElement(parseString(xpp));
2130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityMethod")) {
2131        res.setCausalityMethod(parseCodeableConcept(xpp));
2132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityAuthor")) {
2133        res.setCausalityAuthor(parseReference(xpp));
2134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("causalityResult")) {
2135        res.setCausalityResult(parseCodeableConcept(xpp));
2136      } else if (!parseBackboneContent(eventType, xpp, res))
2137        return false;
2138    return true;
2139  }
2140
2141  protected AllergyIntolerance parseAllergyIntolerance(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2142    AllergyIntolerance res = new AllergyIntolerance();
2143    parseDomainResourceAttributes(xpp, res);
2144    next(xpp);
2145    int eventType = nextNoWhitespace(xpp);
2146    while (eventType != XmlPullParser.END_TAG) {
2147  if (!parseAllergyIntoleranceContent(eventType, xpp, res))
2148        unknownContent(xpp);
2149      eventType = nextNoWhitespace(xpp);
2150    }
2151    next(xpp);
2152    parseElementClose(res);
2153    return res;
2154  }
2155
2156  protected boolean parseAllergyIntoleranceContent(int eventType, XmlPullParser xpp, AllergyIntolerance res) throws XmlPullParserException, IOException, FHIRFormatError {
2157      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2158        res.getIdentifier().add(parseIdentifier(xpp));
2159      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
2160        res.setClinicalStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceClinicalStatus.NULL, new AllergyIntolerance.AllergyIntoleranceClinicalStatusEnumFactory()));
2161      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
2162        res.setVerificationStatusElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceVerificationStatus.NULL, new AllergyIntolerance.AllergyIntoleranceVerificationStatusEnumFactory()));
2163      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2164        res.setTypeElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceType.NULL, new AllergyIntolerance.AllergyIntoleranceTypeEnumFactory()));
2165      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
2166        res.getCategory().add(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCategory.NULL, new AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory()));
2167      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("criticality")) {
2168        res.setCriticalityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceCriticality.NULL, new AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory()));
2169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2170        res.setCode(parseCodeableConcept(xpp));
2171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2172        res.setPatient(parseReference(xpp));
2173      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
2174        res.setOnset(parseType("onset", xpp));
2175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
2176        res.setAssertedDateElement(parseDateTime(xpp));
2177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorder")) {
2178        res.setRecorder(parseReference(xpp));
2179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
2180        res.setAsserter(parseReference(xpp));
2181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastOccurrence")) {
2182        res.setLastOccurrenceElement(parseDateTime(xpp));
2183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2184        res.getNote().add(parseAnnotation(xpp));
2185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reaction")) {
2186        res.getReaction().add(parseAllergyIntoleranceAllergyIntoleranceReactionComponent(xpp, res));
2187      } else if (!parseDomainResourceContent(eventType, xpp, res))
2188        return false;
2189    return true;
2190  }
2191
2192  protected AllergyIntolerance.AllergyIntoleranceReactionComponent parseAllergyIntoleranceAllergyIntoleranceReactionComponent(XmlPullParser xpp, AllergyIntolerance owner) throws XmlPullParserException, IOException, FHIRFormatError {
2193    AllergyIntolerance.AllergyIntoleranceReactionComponent res = new AllergyIntolerance.AllergyIntoleranceReactionComponent();
2194    parseBackboneAttributes(xpp, res);
2195    next(xpp);
2196    int eventType = nextNoWhitespace(xpp);
2197    while (eventType != XmlPullParser.END_TAG) {
2198  if (!parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(eventType, xpp, owner, res))
2199        unknownContent(xpp);
2200      eventType = nextNoWhitespace(xpp);
2201    }
2202    next(xpp);
2203    parseElementClose(res);
2204    return res;
2205  }
2206
2207  protected boolean parseAllergyIntoleranceAllergyIntoleranceReactionComponentContent(int eventType, XmlPullParser xpp, AllergyIntolerance owner, AllergyIntolerance.AllergyIntoleranceReactionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2208      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("substance")) {
2209        res.setSubstance(parseCodeableConcept(xpp));
2210      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manifestation")) {
2211        res.getManifestation().add(parseCodeableConcept(xpp));
2212      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2213        res.setDescriptionElement(parseString(xpp));
2214      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onset")) {
2215        res.setOnsetElement(parseDateTime(xpp));
2216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
2217        res.setSeverityElement(parseEnumeration(xpp, AllergyIntolerance.AllergyIntoleranceSeverity.NULL, new AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory()));
2218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exposureRoute")) {
2219        res.setExposureRoute(parseCodeableConcept(xpp));
2220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
2221        res.getNote().add(parseAnnotation(xpp));
2222      } else if (!parseBackboneContent(eventType, xpp, res))
2223        return false;
2224    return true;
2225  }
2226
2227  protected Appointment parseAppointment(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2228    Appointment res = new Appointment();
2229    parseDomainResourceAttributes(xpp, res);
2230    next(xpp);
2231    int eventType = nextNoWhitespace(xpp);
2232    while (eventType != XmlPullParser.END_TAG) {
2233  if (!parseAppointmentContent(eventType, xpp, res))
2234        unknownContent(xpp);
2235      eventType = nextNoWhitespace(xpp);
2236    }
2237    next(xpp);
2238    parseElementClose(res);
2239    return res;
2240  }
2241
2242  protected boolean parseAppointmentContent(int eventType, XmlPullParser xpp, Appointment res) throws XmlPullParserException, IOException, FHIRFormatError {
2243      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2244        res.getIdentifier().add(parseIdentifier(xpp));
2245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2246        res.setStatusElement(parseEnumeration(xpp, Appointment.AppointmentStatus.NULL, new Appointment.AppointmentStatusEnumFactory()));
2247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceCategory")) {
2248        res.setServiceCategory(parseCodeableConcept(xpp));
2249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceType")) {
2250        res.getServiceType().add(parseCodeableConcept(xpp));
2251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialty")) {
2252        res.getSpecialty().add(parseCodeableConcept(xpp));
2253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointmentType")) {
2254        res.setAppointmentType(parseCodeableConcept(xpp));
2255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
2256        res.getReason().add(parseCodeableConcept(xpp));
2257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
2258        res.getIndication().add(parseReference(xpp));
2259      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
2260        res.setPriorityElement(parseUnsignedInt(xpp));
2261      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2262        res.setDescriptionElement(parseString(xpp));
2263      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
2264        res.getSupportingInformation().add(parseReference(xpp));
2265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2266        res.setStartElement(parseInstant(xpp));
2267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2268        res.setEndElement(parseInstant(xpp));
2269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("minutesDuration")) {
2270        res.setMinutesDurationElement(parsePositiveInt(xpp));
2271      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("slot")) {
2272        res.getSlot().add(parseReference(xpp));
2273      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2274        res.setCreatedElement(parseDateTime(xpp));
2275      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2276        res.setCommentElement(parseString(xpp));
2277      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
2278        res.getIncomingReferral().add(parseReference(xpp));
2279      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
2280        res.getParticipant().add(parseAppointmentAppointmentParticipantComponent(xpp, res));
2281      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestedPeriod")) {
2282        res.getRequestedPeriod().add(parsePeriod(xpp));
2283      } else if (!parseDomainResourceContent(eventType, xpp, res))
2284        return false;
2285    return true;
2286  }
2287
2288  protected Appointment.AppointmentParticipantComponent parseAppointmentAppointmentParticipantComponent(XmlPullParser xpp, Appointment owner) throws XmlPullParserException, IOException, FHIRFormatError {
2289    Appointment.AppointmentParticipantComponent res = new Appointment.AppointmentParticipantComponent();
2290    parseBackboneAttributes(xpp, res);
2291    next(xpp);
2292    int eventType = nextNoWhitespace(xpp);
2293    while (eventType != XmlPullParser.END_TAG) {
2294  if (!parseAppointmentAppointmentParticipantComponentContent(eventType, xpp, owner, res))
2295        unknownContent(xpp);
2296      eventType = nextNoWhitespace(xpp);
2297    }
2298    next(xpp);
2299    parseElementClose(res);
2300    return res;
2301  }
2302
2303  protected boolean parseAppointmentAppointmentParticipantComponentContent(int eventType, XmlPullParser xpp, Appointment owner, Appointment.AppointmentParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2304      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2305        res.getType().add(parseCodeableConcept(xpp));
2306      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2307        res.setActor(parseReference(xpp));
2308      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("required")) {
2309        res.setRequiredElement(parseEnumeration(xpp, Appointment.ParticipantRequired.NULL, new Appointment.ParticipantRequiredEnumFactory()));
2310      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2311        res.setStatusElement(parseEnumeration(xpp, Appointment.ParticipationStatus.NULL, new Appointment.ParticipationStatusEnumFactory()));
2312      } else if (!parseBackboneContent(eventType, xpp, res))
2313        return false;
2314    return true;
2315  }
2316
2317  protected AppointmentResponse parseAppointmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2318    AppointmentResponse res = new AppointmentResponse();
2319    parseDomainResourceAttributes(xpp, res);
2320    next(xpp);
2321    int eventType = nextNoWhitespace(xpp);
2322    while (eventType != XmlPullParser.END_TAG) {
2323  if (!parseAppointmentResponseContent(eventType, xpp, res))
2324        unknownContent(xpp);
2325      eventType = nextNoWhitespace(xpp);
2326    }
2327    next(xpp);
2328    parseElementClose(res);
2329    return res;
2330  }
2331
2332  protected boolean parseAppointmentResponseContent(int eventType, XmlPullParser xpp, AppointmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
2333      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2334        res.getIdentifier().add(parseIdentifier(xpp));
2335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
2336        res.setAppointment(parseReference(xpp));
2337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("start")) {
2338        res.setStartElement(parseInstant(xpp));
2339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("end")) {
2340        res.setEndElement(parseInstant(xpp));
2341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantType")) {
2342        res.getParticipantType().add(parseCodeableConcept(xpp));
2343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
2344        res.setActor(parseReference(xpp));
2345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participantStatus")) {
2346        res.setParticipantStatusElement(parseEnumeration(xpp, AppointmentResponse.ParticipantStatus.NULL, new AppointmentResponse.ParticipantStatusEnumFactory()));
2347      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
2348        res.setCommentElement(parseString(xpp));
2349      } else if (!parseDomainResourceContent(eventType, xpp, res))
2350        return false;
2351    return true;
2352  }
2353
2354  protected AuditEvent parseAuditEvent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2355    AuditEvent res = new AuditEvent();
2356    parseDomainResourceAttributes(xpp, res);
2357    next(xpp);
2358    int eventType = nextNoWhitespace(xpp);
2359    while (eventType != XmlPullParser.END_TAG) {
2360  if (!parseAuditEventContent(eventType, xpp, res))
2361        unknownContent(xpp);
2362      eventType = nextNoWhitespace(xpp);
2363    }
2364    next(xpp);
2365    parseElementClose(res);
2366    return res;
2367  }
2368
2369  protected boolean parseAuditEventContent(int eventType, XmlPullParser xpp, AuditEvent res) throws XmlPullParserException, IOException, FHIRFormatError {
2370      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2371        res.setType(parseCoding(xpp));
2372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subtype")) {
2373        res.getSubtype().add(parseCoding(xpp));
2374      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
2375        res.setActionElement(parseEnumeration(xpp, AuditEvent.AuditEventAction.NULL, new AuditEvent.AuditEventActionEnumFactory()));
2376      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recorded")) {
2377        res.setRecordedElement(parseInstant(xpp));
2378      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2379        res.setOutcomeElement(parseEnumeration(xpp, AuditEvent.AuditEventOutcome.NULL, new AuditEvent.AuditEventOutcomeEnumFactory()));
2380      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeDesc")) {
2381        res.setOutcomeDescElement(parseString(xpp));
2382      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfEvent")) {
2383        res.getPurposeOfEvent().add(parseCodeableConcept(xpp));
2384      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
2385        res.getAgent().add(parseAuditEventAuditEventAgentComponent(xpp, res));
2386      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
2387        res.setSource(parseAuditEventAuditEventSourceComponent(xpp, res));
2388      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entity")) {
2389        res.getEntity().add(parseAuditEventAuditEventEntityComponent(xpp, res));
2390      } else if (!parseDomainResourceContent(eventType, xpp, res))
2391        return false;
2392    return true;
2393  }
2394
2395  protected AuditEvent.AuditEventAgentComponent parseAuditEventAuditEventAgentComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2396    AuditEvent.AuditEventAgentComponent res = new AuditEvent.AuditEventAgentComponent();
2397    parseBackboneAttributes(xpp, res);
2398    next(xpp);
2399    int eventType = nextNoWhitespace(xpp);
2400    while (eventType != XmlPullParser.END_TAG) {
2401  if (!parseAuditEventAuditEventAgentComponentContent(eventType, xpp, owner, res))
2402        unknownContent(xpp);
2403      eventType = nextNoWhitespace(xpp);
2404    }
2405    next(xpp);
2406    parseElementClose(res);
2407    return res;
2408  }
2409
2410  protected boolean parseAuditEventAuditEventAgentComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2411      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2412        res.getRole().add(parseCodeableConcept(xpp));
2413      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2414        res.setReference(parseReference(xpp));
2415      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("userId")) {
2416        res.setUserId(parseIdentifier(xpp));
2417      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("altId")) {
2418        res.setAltIdElement(parseString(xpp));
2419      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2420        res.setNameElement(parseString(xpp));
2421      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestor")) {
2422        res.setRequestorElement(parseBoolean(xpp));
2423      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2424        res.setLocation(parseReference(xpp));
2425      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
2426        res.getPolicy().add(parseUri(xpp));
2427      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("media")) {
2428        res.setMedia(parseCoding(xpp));
2429      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
2430        res.setNetwork(parseAuditEventAuditEventAgentNetworkComponent(xpp, owner));
2431      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purposeOfUse")) {
2432        res.getPurposeOfUse().add(parseCodeableConcept(xpp));
2433      } else if (!parseBackboneContent(eventType, xpp, res))
2434        return false;
2435    return true;
2436  }
2437
2438  protected AuditEvent.AuditEventAgentNetworkComponent parseAuditEventAuditEventAgentNetworkComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2439    AuditEvent.AuditEventAgentNetworkComponent res = new AuditEvent.AuditEventAgentNetworkComponent();
2440    parseBackboneAttributes(xpp, res);
2441    next(xpp);
2442    int eventType = nextNoWhitespace(xpp);
2443    while (eventType != XmlPullParser.END_TAG) {
2444  if (!parseAuditEventAuditEventAgentNetworkComponentContent(eventType, xpp, owner, res))
2445        unknownContent(xpp);
2446      eventType = nextNoWhitespace(xpp);
2447    }
2448    next(xpp);
2449    parseElementClose(res);
2450    return res;
2451  }
2452
2453  protected boolean parseAuditEventAuditEventAgentNetworkComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventAgentNetworkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2454      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
2455        res.setAddressElement(parseString(xpp));
2456      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2457        res.setTypeElement(parseEnumeration(xpp, AuditEvent.AuditEventAgentNetworkType.NULL, new AuditEvent.AuditEventAgentNetworkTypeEnumFactory()));
2458      } else if (!parseBackboneContent(eventType, xpp, res))
2459        return false;
2460    return true;
2461  }
2462
2463  protected AuditEvent.AuditEventSourceComponent parseAuditEventAuditEventSourceComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2464    AuditEvent.AuditEventSourceComponent res = new AuditEvent.AuditEventSourceComponent();
2465    parseBackboneAttributes(xpp, res);
2466    next(xpp);
2467    int eventType = nextNoWhitespace(xpp);
2468    while (eventType != XmlPullParser.END_TAG) {
2469  if (!parseAuditEventAuditEventSourceComponentContent(eventType, xpp, owner, res))
2470        unknownContent(xpp);
2471      eventType = nextNoWhitespace(xpp);
2472    }
2473    next(xpp);
2474    parseElementClose(res);
2475    return res;
2476  }
2477
2478  protected boolean parseAuditEventAuditEventSourceComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventSourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2479      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("site")) {
2480        res.setSiteElement(parseString(xpp));
2481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2482        res.setIdentifier(parseIdentifier(xpp));
2483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2484        res.getType().add(parseCoding(xpp));
2485      } else if (!parseBackboneContent(eventType, xpp, res))
2486        return false;
2487    return true;
2488  }
2489
2490  protected AuditEvent.AuditEventEntityComponent parseAuditEventAuditEventEntityComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2491    AuditEvent.AuditEventEntityComponent res = new AuditEvent.AuditEventEntityComponent();
2492    parseBackboneAttributes(xpp, res);
2493    next(xpp);
2494    int eventType = nextNoWhitespace(xpp);
2495    while (eventType != XmlPullParser.END_TAG) {
2496  if (!parseAuditEventAuditEventEntityComponentContent(eventType, xpp, owner, res))
2497        unknownContent(xpp);
2498      eventType = nextNoWhitespace(xpp);
2499    }
2500    next(xpp);
2501    parseElementClose(res);
2502    return res;
2503  }
2504
2505  protected boolean parseAuditEventAuditEventEntityComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2507        res.setIdentifier(parseIdentifier(xpp));
2508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
2509        res.setReference(parseReference(xpp));
2510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2511        res.setType(parseCoding(xpp));
2512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
2513        res.setRole(parseCoding(xpp));
2514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lifecycle")) {
2515        res.setLifecycle(parseCoding(xpp));
2516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
2517        res.getSecurityLabel().add(parseCoding(xpp));
2518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2519        res.setNameElement(parseString(xpp));
2520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2521        res.setDescriptionElement(parseString(xpp));
2522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("query")) {
2523        res.setQueryElement(parseBase64Binary(xpp));
2524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
2525        res.getDetail().add(parseAuditEventAuditEventEntityDetailComponent(xpp, owner));
2526      } else if (!parseBackboneContent(eventType, xpp, res))
2527        return false;
2528    return true;
2529  }
2530
2531  protected AuditEvent.AuditEventEntityDetailComponent parseAuditEventAuditEventEntityDetailComponent(XmlPullParser xpp, AuditEvent owner) throws XmlPullParserException, IOException, FHIRFormatError {
2532    AuditEvent.AuditEventEntityDetailComponent res = new AuditEvent.AuditEventEntityDetailComponent();
2533    parseBackboneAttributes(xpp, res);
2534    next(xpp);
2535    int eventType = nextNoWhitespace(xpp);
2536    while (eventType != XmlPullParser.END_TAG) {
2537  if (!parseAuditEventAuditEventEntityDetailComponentContent(eventType, xpp, owner, res))
2538        unknownContent(xpp);
2539      eventType = nextNoWhitespace(xpp);
2540    }
2541    next(xpp);
2542    parseElementClose(res);
2543    return res;
2544  }
2545
2546  protected boolean parseAuditEventAuditEventEntityDetailComponentContent(int eventType, XmlPullParser xpp, AuditEvent owner, AuditEvent.AuditEventEntityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2547      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2548        res.setTypeElement(parseString(xpp));
2549      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
2550        res.setValueElement(parseBase64Binary(xpp));
2551      } else if (!parseBackboneContent(eventType, xpp, res))
2552        return false;
2553    return true;
2554  }
2555
2556  protected Basic parseBasic(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2557    Basic res = new Basic();
2558    parseDomainResourceAttributes(xpp, res);
2559    next(xpp);
2560    int eventType = nextNoWhitespace(xpp);
2561    while (eventType != XmlPullParser.END_TAG) {
2562  if (!parseBasicContent(eventType, xpp, res))
2563        unknownContent(xpp);
2564      eventType = nextNoWhitespace(xpp);
2565    }
2566    next(xpp);
2567    parseElementClose(res);
2568    return res;
2569  }
2570
2571  protected boolean parseBasicContent(int eventType, XmlPullParser xpp, Basic res) throws XmlPullParserException, IOException, FHIRFormatError {
2572      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2573        res.getIdentifier().add(parseIdentifier(xpp));
2574      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2575        res.setCode(parseCodeableConcept(xpp));
2576      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
2577        res.setSubject(parseReference(xpp));
2578      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
2579        res.setCreatedElement(parseDate(xpp));
2580      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
2581        res.setAuthor(parseReference(xpp));
2582      } else if (!parseDomainResourceContent(eventType, xpp, res))
2583        return false;
2584    return true;
2585  }
2586
2587  protected Binary parseBinary(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2588    Binary res = new Binary();
2589    parseResourceAttributes(xpp, res);
2590    next(xpp);
2591    int eventType = nextNoWhitespace(xpp);
2592    while (eventType != XmlPullParser.END_TAG) {
2593  if (!parseBinaryContent(eventType, xpp, res))
2594        unknownContent(xpp);
2595      eventType = nextNoWhitespace(xpp);
2596    }
2597    next(xpp);
2598    parseElementClose(res);
2599    return res;
2600  }
2601
2602  protected boolean parseBinaryContent(int eventType, XmlPullParser xpp, Binary res) throws XmlPullParserException, IOException, FHIRFormatError {
2603      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentType")) {
2604        res.setContentTypeElement(parseCode(xpp));
2605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityContext")) {
2606        res.setSecurityContext(parseReference(xpp));
2607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
2608        res.setContentElement(parseBase64Binary(xpp));
2609      } else if (!parseResourceContent(eventType, xpp, res))
2610        return false;
2611    return true;
2612  }
2613
2614  protected BodySite parseBodySite(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2615    BodySite res = new BodySite();
2616    parseDomainResourceAttributes(xpp, res);
2617    next(xpp);
2618    int eventType = nextNoWhitespace(xpp);
2619    while (eventType != XmlPullParser.END_TAG) {
2620  if (!parseBodySiteContent(eventType, xpp, res))
2621        unknownContent(xpp);
2622      eventType = nextNoWhitespace(xpp);
2623    }
2624    next(xpp);
2625    parseElementClose(res);
2626    return res;
2627  }
2628
2629  protected boolean parseBodySiteContent(int eventType, XmlPullParser xpp, BodySite res) throws XmlPullParserException, IOException, FHIRFormatError {
2630      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2631        res.getIdentifier().add(parseIdentifier(xpp));
2632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("active")) {
2633        res.setActiveElement(parseBoolean(xpp));
2634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
2635        res.setCode(parseCodeableConcept(xpp));
2636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualifier")) {
2637        res.getQualifier().add(parseCodeableConcept(xpp));
2638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2639        res.setDescriptionElement(parseString(xpp));
2640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
2641        res.getImage().add(parseAttachment(xpp));
2642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
2643        res.setPatient(parseReference(xpp));
2644      } else if (!parseDomainResourceContent(eventType, xpp, res))
2645        return false;
2646    return true;
2647  }
2648
2649  protected Bundle parseBundle(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2650    Bundle res = new Bundle();
2651    parseResourceAttributes(xpp, res);
2652    next(xpp);
2653    int eventType = nextNoWhitespace(xpp);
2654    while (eventType != XmlPullParser.END_TAG) {
2655  if (!parseBundleContent(eventType, xpp, res))
2656        unknownContent(xpp);
2657      eventType = nextNoWhitespace(xpp);
2658    }
2659    next(xpp);
2660    parseElementClose(res);
2661    return res;
2662  }
2663
2664  protected boolean parseBundleContent(int eventType, XmlPullParser xpp, Bundle res) throws XmlPullParserException, IOException, FHIRFormatError {
2665      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
2666        res.setIdentifier(parseIdentifier(xpp));
2667      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
2668        res.setTypeElement(parseEnumeration(xpp, Bundle.BundleType.NULL, new Bundle.BundleTypeEnumFactory()));
2669      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
2670        res.setTotalElement(parseUnsignedInt(xpp));
2671      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2672        res.getLink().add(parseBundleBundleLinkComponent(xpp, res));
2673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
2674        res.getEntry().add(parseBundleBundleEntryComponent(xpp, res));
2675      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
2676        res.setSignature(parseSignature(xpp));
2677      } else if (!parseResourceContent(eventType, xpp, res))
2678        return false;
2679    return true;
2680  }
2681
2682  protected Bundle.BundleLinkComponent parseBundleBundleLinkComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2683    Bundle.BundleLinkComponent res = new Bundle.BundleLinkComponent();
2684    parseBackboneAttributes(xpp, res);
2685    next(xpp);
2686    int eventType = nextNoWhitespace(xpp);
2687    while (eventType != XmlPullParser.END_TAG) {
2688  if (!parseBundleBundleLinkComponentContent(eventType, xpp, owner, res))
2689        unknownContent(xpp);
2690      eventType = nextNoWhitespace(xpp);
2691    }
2692    next(xpp);
2693    parseElementClose(res);
2694    return res;
2695  }
2696
2697  protected boolean parseBundleBundleLinkComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleLinkComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2698      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relation")) {
2699        res.setRelationElement(parseString(xpp));
2700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2701        res.setUrlElement(parseUri(xpp));
2702      } else if (!parseBackboneContent(eventType, xpp, res))
2703        return false;
2704    return true;
2705  }
2706
2707  protected Bundle.BundleEntryComponent parseBundleBundleEntryComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2708    Bundle.BundleEntryComponent res = new Bundle.BundleEntryComponent();
2709    parseBackboneAttributes(xpp, res);
2710    next(xpp);
2711    int eventType = nextNoWhitespace(xpp);
2712    while (eventType != XmlPullParser.END_TAG) {
2713  if (!parseBundleBundleEntryComponentContent(eventType, xpp, owner, res))
2714        unknownContent(xpp);
2715      eventType = nextNoWhitespace(xpp);
2716    }
2717    next(xpp);
2718    parseElementClose(res);
2719    return res;
2720  }
2721
2722  protected boolean parseBundleBundleEntryComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2723      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
2724        res.getLink().add(parseBundleBundleLinkComponent(xpp, owner));
2725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fullUrl")) {
2726        res.setFullUrlElement(parseUri(xpp));
2727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2728        res.setResource(parseResourceContained(xpp));
2729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
2730        res.setSearch(parseBundleBundleEntrySearchComponent(xpp, owner));
2731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
2732        res.setRequest(parseBundleBundleEntryRequestComponent(xpp, owner));
2733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
2734        res.setResponse(parseBundleBundleEntryResponseComponent(xpp, owner));
2735      } else if (!parseBackboneContent(eventType, xpp, res))
2736        return false;
2737    return true;
2738  }
2739
2740  protected Bundle.BundleEntrySearchComponent parseBundleBundleEntrySearchComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2741    Bundle.BundleEntrySearchComponent res = new Bundle.BundleEntrySearchComponent();
2742    parseBackboneAttributes(xpp, res);
2743    next(xpp);
2744    int eventType = nextNoWhitespace(xpp);
2745    while (eventType != XmlPullParser.END_TAG) {
2746  if (!parseBundleBundleEntrySearchComponentContent(eventType, xpp, owner, res))
2747        unknownContent(xpp);
2748      eventType = nextNoWhitespace(xpp);
2749    }
2750    next(xpp);
2751    parseElementClose(res);
2752    return res;
2753  }
2754
2755  protected boolean parseBundleBundleEntrySearchComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntrySearchComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2756      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2757        res.setModeElement(parseEnumeration(xpp, Bundle.SearchEntryMode.NULL, new Bundle.SearchEntryModeEnumFactory()));
2758      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("score")) {
2759        res.setScoreElement(parseDecimal(xpp));
2760      } else if (!parseBackboneContent(eventType, xpp, res))
2761        return false;
2762    return true;
2763  }
2764
2765  protected Bundle.BundleEntryRequestComponent parseBundleBundleEntryRequestComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2766    Bundle.BundleEntryRequestComponent res = new Bundle.BundleEntryRequestComponent();
2767    parseBackboneAttributes(xpp, res);
2768    next(xpp);
2769    int eventType = nextNoWhitespace(xpp);
2770    while (eventType != XmlPullParser.END_TAG) {
2771  if (!parseBundleBundleEntryRequestComponentContent(eventType, xpp, owner, res))
2772        unknownContent(xpp);
2773      eventType = nextNoWhitespace(xpp);
2774    }
2775    next(xpp);
2776    parseElementClose(res);
2777    return res;
2778  }
2779
2780  protected boolean parseBundleBundleEntryRequestComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryRequestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2781      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("method")) {
2782        res.setMethodElement(parseEnumeration(xpp, Bundle.HTTPVerb.NULL, new Bundle.HTTPVerbEnumFactory()));
2783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2784        res.setUrlElement(parseUri(xpp));
2785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneMatch")) {
2786        res.setIfNoneMatchElement(parseString(xpp));
2787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifModifiedSince")) {
2788        res.setIfModifiedSinceElement(parseInstant(xpp));
2789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifMatch")) {
2790        res.setIfMatchElement(parseString(xpp));
2791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ifNoneExist")) {
2792        res.setIfNoneExistElement(parseString(xpp));
2793      } else if (!parseBackboneContent(eventType, xpp, res))
2794        return false;
2795    return true;
2796  }
2797
2798  protected Bundle.BundleEntryResponseComponent parseBundleBundleEntryResponseComponent(XmlPullParser xpp, Bundle owner) throws XmlPullParserException, IOException, FHIRFormatError {
2799    Bundle.BundleEntryResponseComponent res = new Bundle.BundleEntryResponseComponent();
2800    parseBackboneAttributes(xpp, res);
2801    next(xpp);
2802    int eventType = nextNoWhitespace(xpp);
2803    while (eventType != XmlPullParser.END_TAG) {
2804  if (!parseBundleBundleEntryResponseComponentContent(eventType, xpp, owner, res))
2805        unknownContent(xpp);
2806      eventType = nextNoWhitespace(xpp);
2807    }
2808    next(xpp);
2809    parseElementClose(res);
2810    return res;
2811  }
2812
2813  protected boolean parseBundleBundleEntryResponseComponentContent(int eventType, XmlPullParser xpp, Bundle owner, Bundle.BundleEntryResponseComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2814      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2815        res.setStatusElement(parseString(xpp));
2816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
2817        res.setLocationElement(parseUri(xpp));
2818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("etag")) {
2819        res.setEtagElement(parseString(xpp));
2820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastModified")) {
2821        res.setLastModifiedElement(parseInstant(xpp));
2822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
2823        res.setOutcome(parseResourceContained(xpp));
2824      } else if (!parseBackboneContent(eventType, xpp, res))
2825        return false;
2826    return true;
2827  }
2828
2829  protected CapabilityStatement parseCapabilityStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
2830    CapabilityStatement res = new CapabilityStatement();
2831    parseDomainResourceAttributes(xpp, res);
2832    next(xpp);
2833    int eventType = nextNoWhitespace(xpp);
2834    while (eventType != XmlPullParser.END_TAG) {
2835  if (!parseCapabilityStatementContent(eventType, xpp, res))
2836        unknownContent(xpp);
2837      eventType = nextNoWhitespace(xpp);
2838    }
2839    next(xpp);
2840    parseElementClose(res);
2841    return res;
2842  }
2843
2844  protected boolean parseCapabilityStatementContent(int eventType, XmlPullParser xpp, CapabilityStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
2845      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2846        res.setUrlElement(parseUri(xpp));
2847      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2848        res.setVersionElement(parseString(xpp));
2849      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2850        res.setNameElement(parseString(xpp));
2851      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
2852        res.setTitleElement(parseString(xpp));
2853      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
2854        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
2855      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
2856        res.setExperimentalElement(parseBoolean(xpp));
2857      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
2858        res.setDateElement(parseDateTime(xpp));
2859      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
2860        res.setPublisherElement(parseString(xpp));
2861      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
2862        res.getContact().add(parseContactDetail(xpp));
2863      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2864        res.setDescriptionElement(parseMarkdown(xpp));
2865      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
2866        res.getUseContext().add(parseUsageContext(xpp));
2867      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
2868        res.getJurisdiction().add(parseCodeableConcept(xpp));
2869      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
2870        res.setPurposeElement(parseMarkdown(xpp));
2871      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
2872        res.setCopyrightElement(parseMarkdown(xpp));
2873      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("kind")) {
2874        res.setKindElement(parseEnumeration(xpp, CapabilityStatement.CapabilityStatementKind.NULL, new CapabilityStatement.CapabilityStatementKindEnumFactory()));
2875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("instantiates")) {
2876        res.getInstantiates().add(parseUri(xpp));
2877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("software")) {
2878        res.setSoftware(parseCapabilityStatementCapabilityStatementSoftwareComponent(xpp, res));
2879      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementation")) {
2880        res.setImplementation(parseCapabilityStatementCapabilityStatementImplementationComponent(xpp, res));
2881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fhirVersion")) {
2882        res.setFhirVersionElement(parseId(xpp));
2883      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("acceptUnknown")) {
2884        res.setAcceptUnknownElement(parseEnumeration(xpp, CapabilityStatement.UnknownContentCode.NULL, new CapabilityStatement.UnknownContentCodeEnumFactory()));
2885      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
2886        res.getFormat().add(parseCode(xpp));
2887      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patchFormat")) {
2888        res.getPatchFormat().add(parseCode(xpp));
2889      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implementationGuide")) {
2890        res.getImplementationGuide().add(parseUri(xpp));
2891      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
2892        res.getProfile().add(parseReference(xpp));
2893      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rest")) {
2894        res.getRest().add(parseCapabilityStatementCapabilityStatementRestComponent(xpp, res));
2895      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("messaging")) {
2896        res.getMessaging().add(parseCapabilityStatementCapabilityStatementMessagingComponent(xpp, res));
2897      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("document")) {
2898        res.getDocument().add(parseCapabilityStatementCapabilityStatementDocumentComponent(xpp, res));
2899      } else if (!parseDomainResourceContent(eventType, xpp, res))
2900        return false;
2901    return true;
2902  }
2903
2904  protected CapabilityStatement.CapabilityStatementSoftwareComponent parseCapabilityStatementCapabilityStatementSoftwareComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2905    CapabilityStatement.CapabilityStatementSoftwareComponent res = new CapabilityStatement.CapabilityStatementSoftwareComponent();
2906    parseBackboneAttributes(xpp, res);
2907    next(xpp);
2908    int eventType = nextNoWhitespace(xpp);
2909    while (eventType != XmlPullParser.END_TAG) {
2910  if (!parseCapabilityStatementCapabilityStatementSoftwareComponentContent(eventType, xpp, owner, res))
2911        unknownContent(xpp);
2912      eventType = nextNoWhitespace(xpp);
2913    }
2914    next(xpp);
2915    parseElementClose(res);
2916    return res;
2917  }
2918
2919  protected boolean parseCapabilityStatementCapabilityStatementSoftwareComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementSoftwareComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2920      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
2921        res.setNameElement(parseString(xpp));
2922      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
2923        res.setVersionElement(parseString(xpp));
2924      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("releaseDate")) {
2925        res.setReleaseDateElement(parseDateTime(xpp));
2926      } else if (!parseBackboneContent(eventType, xpp, res))
2927        return false;
2928    return true;
2929  }
2930
2931  protected CapabilityStatement.CapabilityStatementImplementationComponent parseCapabilityStatementCapabilityStatementImplementationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2932    CapabilityStatement.CapabilityStatementImplementationComponent res = new CapabilityStatement.CapabilityStatementImplementationComponent();
2933    parseBackboneAttributes(xpp, res);
2934    next(xpp);
2935    int eventType = nextNoWhitespace(xpp);
2936    while (eventType != XmlPullParser.END_TAG) {
2937  if (!parseCapabilityStatementCapabilityStatementImplementationComponentContent(eventType, xpp, owner, res))
2938        unknownContent(xpp);
2939      eventType = nextNoWhitespace(xpp);
2940    }
2941    next(xpp);
2942    parseElementClose(res);
2943    return res;
2944  }
2945
2946  protected boolean parseCapabilityStatementCapabilityStatementImplementationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementImplementationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2947      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
2948        res.setDescriptionElement(parseString(xpp));
2949      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
2950        res.setUrlElement(parseUri(xpp));
2951      } else if (!parseBackboneContent(eventType, xpp, res))
2952        return false;
2953    return true;
2954  }
2955
2956  protected CapabilityStatement.CapabilityStatementRestComponent parseCapabilityStatementCapabilityStatementRestComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2957    CapabilityStatement.CapabilityStatementRestComponent res = new CapabilityStatement.CapabilityStatementRestComponent();
2958    parseBackboneAttributes(xpp, res);
2959    next(xpp);
2960    int eventType = nextNoWhitespace(xpp);
2961    while (eventType != XmlPullParser.END_TAG) {
2962  if (!parseCapabilityStatementCapabilityStatementRestComponentContent(eventType, xpp, owner, res))
2963        unknownContent(xpp);
2964      eventType = nextNoWhitespace(xpp);
2965    }
2966    next(xpp);
2967    parseElementClose(res);
2968    return res;
2969  }
2970
2971  protected boolean parseCapabilityStatementCapabilityStatementRestComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
2972      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
2973        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.RestfulCapabilityMode.NULL, new CapabilityStatement.RestfulCapabilityModeEnumFactory()));
2974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
2975        res.setDocumentationElement(parseString(xpp));
2976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("security")) {
2977        res.setSecurity(parseCapabilityStatementCapabilityStatementRestSecurityComponent(xpp, owner));
2978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
2979        res.getResource().add(parseCapabilityStatementCapabilityStatementRestResourceComponent(xpp, owner));
2980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
2981        res.getInteraction().add(parseCapabilityStatementSystemInteractionComponent(xpp, owner));
2982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
2983        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
2984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operation")) {
2985        res.getOperation().add(parseCapabilityStatementCapabilityStatementRestOperationComponent(xpp, owner));
2986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compartment")) {
2987        res.getCompartment().add(parseUri(xpp));
2988      } else if (!parseBackboneContent(eventType, xpp, res))
2989        return false;
2990    return true;
2991  }
2992
2993  protected CapabilityStatement.CapabilityStatementRestSecurityComponent parseCapabilityStatementCapabilityStatementRestSecurityComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
2994    CapabilityStatement.CapabilityStatementRestSecurityComponent res = new CapabilityStatement.CapabilityStatementRestSecurityComponent();
2995    parseBackboneAttributes(xpp, res);
2996    next(xpp);
2997    int eventType = nextNoWhitespace(xpp);
2998    while (eventType != XmlPullParser.END_TAG) {
2999  if (!parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(eventType, xpp, owner, res))
3000        unknownContent(xpp);
3001      eventType = nextNoWhitespace(xpp);
3002    }
3003    next(xpp);
3004    parseElementClose(res);
3005    return res;
3006  }
3007
3008  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3009      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("cors")) {
3010        res.setCorsElement(parseBoolean(xpp));
3011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3012        res.getService().add(parseCodeableConcept(xpp));
3013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3014        res.setDescriptionElement(parseString(xpp));
3015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("certificate")) {
3016        res.getCertificate().add(parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(xpp, owner));
3017      } else if (!parseBackboneContent(eventType, xpp, res))
3018        return false;
3019    return true;
3020  }
3021
3022  protected CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3023    CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res = new CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent();
3024    parseBackboneAttributes(xpp, res);
3025    next(xpp);
3026    int eventType = nextNoWhitespace(xpp);
3027    while (eventType != XmlPullParser.END_TAG) {
3028  if (!parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(eventType, xpp, owner, res))
3029        unknownContent(xpp);
3030      eventType = nextNoWhitespace(xpp);
3031    }
3032    next(xpp);
3033    parseElementClose(res);
3034    return res;
3035  }
3036
3037  protected boolean parseCapabilityStatementCapabilityStatementRestSecurityCertificateComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestSecurityCertificateComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3038      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3039        res.setTypeElement(parseCode(xpp));
3040      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("blob")) {
3041        res.setBlobElement(parseBase64Binary(xpp));
3042      } else if (!parseBackboneContent(eventType, xpp, res))
3043        return false;
3044    return true;
3045  }
3046
3047  protected CapabilityStatement.CapabilityStatementRestResourceComponent parseCapabilityStatementCapabilityStatementRestResourceComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3048    CapabilityStatement.CapabilityStatementRestResourceComponent res = new CapabilityStatement.CapabilityStatementRestResourceComponent();
3049    parseBackboneAttributes(xpp, res);
3050    next(xpp);
3051    int eventType = nextNoWhitespace(xpp);
3052    while (eventType != XmlPullParser.END_TAG) {
3053  if (!parseCapabilityStatementCapabilityStatementRestResourceComponentContent(eventType, xpp, owner, res))
3054        unknownContent(xpp);
3055      eventType = nextNoWhitespace(xpp);
3056    }
3057    next(xpp);
3058    parseElementClose(res);
3059    return res;
3060  }
3061
3062  protected boolean parseCapabilityStatementCapabilityStatementRestResourceComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3063      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3064        res.setTypeElement(parseCode(xpp));
3065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3066        res.setProfile(parseReference(xpp));
3067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3068        res.setDocumentationElement(parseMarkdown(xpp));
3069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("interaction")) {
3070        res.getInteraction().add(parseCapabilityStatementResourceInteractionComponent(xpp, owner));
3071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versioning")) {
3072        res.setVersioningElement(parseEnumeration(xpp, CapabilityStatement.ResourceVersionPolicy.NULL, new CapabilityStatement.ResourceVersionPolicyEnumFactory()));
3073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("readHistory")) {
3074        res.setReadHistoryElement(parseBoolean(xpp));
3075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("updateCreate")) {
3076        res.setUpdateCreateElement(parseBoolean(xpp));
3077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalCreate")) {
3078        res.setConditionalCreateElement(parseBoolean(xpp));
3079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalRead")) {
3080        res.setConditionalReadElement(parseEnumeration(xpp, CapabilityStatement.ConditionalReadStatus.NULL, new CapabilityStatement.ConditionalReadStatusEnumFactory()));
3081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalUpdate")) {
3082        res.setConditionalUpdateElement(parseBoolean(xpp));
3083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conditionalDelete")) {
3084        res.setConditionalDeleteElement(parseEnumeration(xpp, CapabilityStatement.ConditionalDeleteStatus.NULL, new CapabilityStatement.ConditionalDeleteStatusEnumFactory()));
3085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referencePolicy")) {
3086        res.getReferencePolicy().add(parseEnumeration(xpp, CapabilityStatement.ReferenceHandlingPolicy.NULL, new CapabilityStatement.ReferenceHandlingPolicyEnumFactory()));
3087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchInclude")) {
3088        res.getSearchInclude().add(parseString(xpp));
3089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchRevInclude")) {
3090        res.getSearchRevInclude().add(parseString(xpp));
3091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("searchParam")) {
3092        res.getSearchParam().add(parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(xpp, owner));
3093      } else if (!parseBackboneContent(eventType, xpp, res))
3094        return false;
3095    return true;
3096  }
3097
3098  protected CapabilityStatement.ResourceInteractionComponent parseCapabilityStatementResourceInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3099    CapabilityStatement.ResourceInteractionComponent res = new CapabilityStatement.ResourceInteractionComponent();
3100    parseBackboneAttributes(xpp, res);
3101    next(xpp);
3102    int eventType = nextNoWhitespace(xpp);
3103    while (eventType != XmlPullParser.END_TAG) {
3104  if (!parseCapabilityStatementResourceInteractionComponentContent(eventType, xpp, owner, res))
3105        unknownContent(xpp);
3106      eventType = nextNoWhitespace(xpp);
3107    }
3108    next(xpp);
3109    parseElementClose(res);
3110    return res;
3111  }
3112
3113  protected boolean parseCapabilityStatementResourceInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.ResourceInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3114      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3115        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.TypeRestfulInteraction.NULL, new CapabilityStatement.TypeRestfulInteractionEnumFactory()));
3116      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3117        res.setDocumentationElement(parseString(xpp));
3118      } else if (!parseBackboneContent(eventType, xpp, res))
3119        return false;
3120    return true;
3121  }
3122
3123  protected CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3124    CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res = new CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent();
3125    parseBackboneAttributes(xpp, res);
3126    next(xpp);
3127    int eventType = nextNoWhitespace(xpp);
3128    while (eventType != XmlPullParser.END_TAG) {
3129  if (!parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(eventType, xpp, owner, res))
3130        unknownContent(xpp);
3131      eventType = nextNoWhitespace(xpp);
3132    }
3133    next(xpp);
3134    parseElementClose(res);
3135    return res;
3136  }
3137
3138  protected boolean parseCapabilityStatementCapabilityStatementRestResourceSearchParamComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestResourceSearchParamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3139      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3140        res.setNameElement(parseString(xpp));
3141      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3142        res.setDefinitionElement(parseUri(xpp));
3143      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3144        res.setTypeElement(parseEnumeration(xpp, Enumerations.SearchParamType.NULL, new Enumerations.SearchParamTypeEnumFactory()));
3145      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3146        res.setDocumentationElement(parseString(xpp));
3147      } else if (!parseBackboneContent(eventType, xpp, res))
3148        return false;
3149    return true;
3150  }
3151
3152  protected CapabilityStatement.SystemInteractionComponent parseCapabilityStatementSystemInteractionComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3153    CapabilityStatement.SystemInteractionComponent res = new CapabilityStatement.SystemInteractionComponent();
3154    parseBackboneAttributes(xpp, res);
3155    next(xpp);
3156    int eventType = nextNoWhitespace(xpp);
3157    while (eventType != XmlPullParser.END_TAG) {
3158  if (!parseCapabilityStatementSystemInteractionComponentContent(eventType, xpp, owner, res))
3159        unknownContent(xpp);
3160      eventType = nextNoWhitespace(xpp);
3161    }
3162    next(xpp);
3163    parseElementClose(res);
3164    return res;
3165  }
3166
3167  protected boolean parseCapabilityStatementSystemInteractionComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.SystemInteractionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3168      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3169        res.setCodeElement(parseEnumeration(xpp, CapabilityStatement.SystemRestfulInteraction.NULL, new CapabilityStatement.SystemRestfulInteractionEnumFactory()));
3170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3171        res.setDocumentationElement(parseString(xpp));
3172      } else if (!parseBackboneContent(eventType, xpp, res))
3173        return false;
3174    return true;
3175  }
3176
3177  protected CapabilityStatement.CapabilityStatementRestOperationComponent parseCapabilityStatementCapabilityStatementRestOperationComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3178    CapabilityStatement.CapabilityStatementRestOperationComponent res = new CapabilityStatement.CapabilityStatementRestOperationComponent();
3179    parseBackboneAttributes(xpp, res);
3180    next(xpp);
3181    int eventType = nextNoWhitespace(xpp);
3182    while (eventType != XmlPullParser.END_TAG) {
3183  if (!parseCapabilityStatementCapabilityStatementRestOperationComponentContent(eventType, xpp, owner, res))
3184        unknownContent(xpp);
3185      eventType = nextNoWhitespace(xpp);
3186    }
3187    next(xpp);
3188    parseElementClose(res);
3189    return res;
3190  }
3191
3192  protected boolean parseCapabilityStatementCapabilityStatementRestOperationComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementRestOperationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3193      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3194        res.setNameElement(parseString(xpp));
3195      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3196        res.setDefinition(parseReference(xpp));
3197      } else if (!parseBackboneContent(eventType, xpp, res))
3198        return false;
3199    return true;
3200  }
3201
3202  protected CapabilityStatement.CapabilityStatementMessagingComponent parseCapabilityStatementCapabilityStatementMessagingComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3203    CapabilityStatement.CapabilityStatementMessagingComponent res = new CapabilityStatement.CapabilityStatementMessagingComponent();
3204    parseBackboneAttributes(xpp, res);
3205    next(xpp);
3206    int eventType = nextNoWhitespace(xpp);
3207    while (eventType != XmlPullParser.END_TAG) {
3208  if (!parseCapabilityStatementCapabilityStatementMessagingComponentContent(eventType, xpp, owner, res))
3209        unknownContent(xpp);
3210      eventType = nextNoWhitespace(xpp);
3211    }
3212    next(xpp);
3213    parseElementClose(res);
3214    return res;
3215  }
3216
3217  protected boolean parseCapabilityStatementCapabilityStatementMessagingComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3218      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("endpoint")) {
3219        res.getEndpoint().add(parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(xpp, owner));
3220      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reliableCache")) {
3221        res.setReliableCacheElement(parseUnsignedInt(xpp));
3222      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3223        res.setDocumentationElement(parseString(xpp));
3224      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportedMessage")) {
3225        res.getSupportedMessage().add(parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(xpp, owner));
3226      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
3227        res.getEvent().add(parseCapabilityStatementCapabilityStatementMessagingEventComponent(xpp, owner));
3228      } else if (!parseBackboneContent(eventType, xpp, res))
3229        return false;
3230    return true;
3231  }
3232
3233  protected CapabilityStatement.CapabilityStatementMessagingEndpointComponent parseCapabilityStatementCapabilityStatementMessagingEndpointComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3234    CapabilityStatement.CapabilityStatementMessagingEndpointComponent res = new CapabilityStatement.CapabilityStatementMessagingEndpointComponent();
3235    parseBackboneAttributes(xpp, res);
3236    next(xpp);
3237    int eventType = nextNoWhitespace(xpp);
3238    while (eventType != XmlPullParser.END_TAG) {
3239  if (!parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(eventType, xpp, owner, res))
3240        unknownContent(xpp);
3241      eventType = nextNoWhitespace(xpp);
3242    }
3243    next(xpp);
3244    parseElementClose(res);
3245    return res;
3246  }
3247
3248  protected boolean parseCapabilityStatementCapabilityStatementMessagingEndpointComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEndpointComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3249      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
3250        res.setProtocol(parseCoding(xpp));
3251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
3252        res.setAddressElement(parseUri(xpp));
3253      } else if (!parseBackboneContent(eventType, xpp, res))
3254        return false;
3255    return true;
3256  }
3257
3258  protected CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3259    CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res = new CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent();
3260    parseBackboneAttributes(xpp, res);
3261    next(xpp);
3262    int eventType = nextNoWhitespace(xpp);
3263    while (eventType != XmlPullParser.END_TAG) {
3264  if (!parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(eventType, xpp, owner, res))
3265        unknownContent(xpp);
3266      eventType = nextNoWhitespace(xpp);
3267    }
3268    next(xpp);
3269    parseElementClose(res);
3270    return res;
3271  }
3272
3273  protected boolean parseCapabilityStatementCapabilityStatementMessagingSupportedMessageComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingSupportedMessageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3274      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3275        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3276      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3277        res.setDefinition(parseReference(xpp));
3278      } else if (!parseBackboneContent(eventType, xpp, res))
3279        return false;
3280    return true;
3281  }
3282
3283  protected CapabilityStatement.CapabilityStatementMessagingEventComponent parseCapabilityStatementCapabilityStatementMessagingEventComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3284    CapabilityStatement.CapabilityStatementMessagingEventComponent res = new CapabilityStatement.CapabilityStatementMessagingEventComponent();
3285    parseBackboneAttributes(xpp, res);
3286    next(xpp);
3287    int eventType = nextNoWhitespace(xpp);
3288    while (eventType != XmlPullParser.END_TAG) {
3289  if (!parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(eventType, xpp, owner, res))
3290        unknownContent(xpp);
3291      eventType = nextNoWhitespace(xpp);
3292    }
3293    next(xpp);
3294    parseElementClose(res);
3295    return res;
3296  }
3297
3298  protected boolean parseCapabilityStatementCapabilityStatementMessagingEventComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementMessagingEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3299      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3300        res.setCode(parseCoding(xpp));
3301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3302        res.setCategoryElement(parseEnumeration(xpp, CapabilityStatement.MessageSignificanceCategory.NULL, new CapabilityStatement.MessageSignificanceCategoryEnumFactory()));
3303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3304        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.EventCapabilityMode.NULL, new CapabilityStatement.EventCapabilityModeEnumFactory()));
3305      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focus")) {
3306        res.setFocusElement(parseCode(xpp));
3307      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
3308        res.setRequest(parseReference(xpp));
3309      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("response")) {
3310        res.setResponse(parseReference(xpp));
3311      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3312        res.setDocumentationElement(parseString(xpp));
3313      } else if (!parseBackboneContent(eventType, xpp, res))
3314        return false;
3315    return true;
3316  }
3317
3318  protected CapabilityStatement.CapabilityStatementDocumentComponent parseCapabilityStatementCapabilityStatementDocumentComponent(XmlPullParser xpp, CapabilityStatement owner) throws XmlPullParserException, IOException, FHIRFormatError {
3319    CapabilityStatement.CapabilityStatementDocumentComponent res = new CapabilityStatement.CapabilityStatementDocumentComponent();
3320    parseBackboneAttributes(xpp, res);
3321    next(xpp);
3322    int eventType = nextNoWhitespace(xpp);
3323    while (eventType != XmlPullParser.END_TAG) {
3324  if (!parseCapabilityStatementCapabilityStatementDocumentComponentContent(eventType, xpp, owner, res))
3325        unknownContent(xpp);
3326      eventType = nextNoWhitespace(xpp);
3327    }
3328    next(xpp);
3329    parseElementClose(res);
3330    return res;
3331  }
3332
3333  protected boolean parseCapabilityStatementCapabilityStatementDocumentComponentContent(int eventType, XmlPullParser xpp, CapabilityStatement owner, CapabilityStatement.CapabilityStatementDocumentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3334      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
3335        res.setModeElement(parseEnumeration(xpp, CapabilityStatement.DocumentMode.NULL, new CapabilityStatement.DocumentModeEnumFactory()));
3336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
3337        res.setDocumentationElement(parseString(xpp));
3338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("profile")) {
3339        res.setProfile(parseReference(xpp));
3340      } else if (!parseBackboneContent(eventType, xpp, res))
3341        return false;
3342    return true;
3343  }
3344
3345  protected CarePlan parseCarePlan(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3346    CarePlan res = new CarePlan();
3347    parseDomainResourceAttributes(xpp, res);
3348    next(xpp);
3349    int eventType = nextNoWhitespace(xpp);
3350    while (eventType != XmlPullParser.END_TAG) {
3351  if (!parseCarePlanContent(eventType, xpp, res))
3352        unknownContent(xpp);
3353      eventType = nextNoWhitespace(xpp);
3354    }
3355    next(xpp);
3356    parseElementClose(res);
3357    return res;
3358  }
3359
3360  protected boolean parseCarePlanContent(int eventType, XmlPullParser xpp, CarePlan res) throws XmlPullParserException, IOException, FHIRFormatError {
3361      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3362        res.getIdentifier().add(parseIdentifier(xpp));
3363      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3364        res.getDefinition().add(parseReference(xpp));
3365      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
3366        res.getBasedOn().add(parseReference(xpp));
3367      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
3368        res.getReplaces().add(parseReference(xpp));
3369      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3370        res.getPartOf().add(parseReference(xpp));
3371      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3372        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanStatus.NULL, new CarePlan.CarePlanStatusEnumFactory()));
3373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
3374        res.setIntentElement(parseEnumeration(xpp, CarePlan.CarePlanIntent.NULL, new CarePlan.CarePlanIntentEnumFactory()));
3375      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3376        res.getCategory().add(parseCodeableConcept(xpp));
3377      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
3378        res.setTitleElement(parseString(xpp));
3379      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3380        res.setDescriptionElement(parseString(xpp));
3381      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3382        res.setSubject(parseReference(xpp));
3383      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3384        res.setContext(parseReference(xpp));
3385      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3386        res.setPeriod(parsePeriod(xpp));
3387      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
3388        res.getAuthor().add(parseReference(xpp));
3389      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3390        res.getCareTeam().add(parseReference(xpp));
3391      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addresses")) {
3392        res.getAddresses().add(parseReference(xpp));
3393      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
3394        res.getSupportingInfo().add(parseReference(xpp));
3395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3396        res.getGoal().add(parseReference(xpp));
3397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activity")) {
3398        res.getActivity().add(parseCarePlanCarePlanActivityComponent(xpp, res));
3399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3400        res.getNote().add(parseAnnotation(xpp));
3401      } else if (!parseDomainResourceContent(eventType, xpp, res))
3402        return false;
3403    return true;
3404  }
3405
3406  protected CarePlan.CarePlanActivityComponent parseCarePlanCarePlanActivityComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3407    CarePlan.CarePlanActivityComponent res = new CarePlan.CarePlanActivityComponent();
3408    parseBackboneAttributes(xpp, res);
3409    next(xpp);
3410    int eventType = nextNoWhitespace(xpp);
3411    while (eventType != XmlPullParser.END_TAG) {
3412  if (!parseCarePlanCarePlanActivityComponentContent(eventType, xpp, owner, res))
3413        unknownContent(xpp);
3414      eventType = nextNoWhitespace(xpp);
3415    }
3416    next(xpp);
3417    parseElementClose(res);
3418    return res;
3419  }
3420
3421  protected boolean parseCarePlanCarePlanActivityComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3422      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeCodeableConcept")) {
3423        res.getOutcomeCodeableConcept().add(parseCodeableConcept(xpp));
3424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcomeReference")) {
3425        res.getOutcomeReference().add(parseReference(xpp));
3426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("progress")) {
3427        res.getProgress().add(parseAnnotation(xpp));
3428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3429        res.setReference(parseReference(xpp));
3430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
3431        res.setDetail(parseCarePlanCarePlanActivityDetailComponent(xpp, owner));
3432      } else if (!parseBackboneContent(eventType, xpp, res))
3433        return false;
3434    return true;
3435  }
3436
3437  protected CarePlan.CarePlanActivityDetailComponent parseCarePlanCarePlanActivityDetailComponent(XmlPullParser xpp, CarePlan owner) throws XmlPullParserException, IOException, FHIRFormatError {
3438    CarePlan.CarePlanActivityDetailComponent res = new CarePlan.CarePlanActivityDetailComponent();
3439    parseBackboneAttributes(xpp, res);
3440    next(xpp);
3441    int eventType = nextNoWhitespace(xpp);
3442    while (eventType != XmlPullParser.END_TAG) {
3443  if (!parseCarePlanCarePlanActivityDetailComponentContent(eventType, xpp, owner, res))
3444        unknownContent(xpp);
3445      eventType = nextNoWhitespace(xpp);
3446    }
3447    next(xpp);
3448    parseElementClose(res);
3449    return res;
3450  }
3451
3452  protected boolean parseCarePlanCarePlanActivityDetailComponentContent(int eventType, XmlPullParser xpp, CarePlan owner, CarePlan.CarePlanActivityDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3453      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3454        res.setCategory(parseCodeableConcept(xpp));
3455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3456        res.setDefinition(parseReference(xpp));
3457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3458        res.setCode(parseCodeableConcept(xpp));
3459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3460        res.getReasonCode().add(parseCodeableConcept(xpp));
3461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3462        res.getReasonReference().add(parseReference(xpp));
3463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("goal")) {
3464        res.getGoal().add(parseReference(xpp));
3465      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3466        res.setStatusElement(parseEnumeration(xpp, CarePlan.CarePlanActivityStatus.NULL, new CarePlan.CarePlanActivityStatusEnumFactory()));
3467      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusReason")) {
3468        res.setStatusReasonElement(parseString(xpp));
3469      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prohibited")) {
3470        res.setProhibitedElement(parseBoolean(xpp));
3471      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "scheduled")) {
3472        res.setScheduled(parseType("scheduled", xpp));
3473      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
3474        res.setLocation(parseReference(xpp));
3475      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
3476        res.getPerformer().add(parseReference(xpp));
3477      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "product")) {
3478        res.setProduct(parseType("product", xpp));
3479      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dailyAmount")) {
3480        res.setDailyAmount(parseSimpleQuantity(xpp));
3481      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3482        res.setQuantity(parseSimpleQuantity(xpp));
3483      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
3484        res.setDescriptionElement(parseString(xpp));
3485      } else if (!parseBackboneContent(eventType, xpp, res))
3486        return false;
3487    return true;
3488  }
3489
3490  protected CareTeam parseCareTeam(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3491    CareTeam res = new CareTeam();
3492    parseDomainResourceAttributes(xpp, res);
3493    next(xpp);
3494    int eventType = nextNoWhitespace(xpp);
3495    while (eventType != XmlPullParser.END_TAG) {
3496  if (!parseCareTeamContent(eventType, xpp, res))
3497        unknownContent(xpp);
3498      eventType = nextNoWhitespace(xpp);
3499    }
3500    next(xpp);
3501    parseElementClose(res);
3502    return res;
3503  }
3504
3505  protected boolean parseCareTeamContent(int eventType, XmlPullParser xpp, CareTeam res) throws XmlPullParserException, IOException, FHIRFormatError {
3506      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3507        res.getIdentifier().add(parseIdentifier(xpp));
3508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3509        res.setStatusElement(parseEnumeration(xpp, CareTeam.CareTeamStatus.NULL, new CareTeam.CareTeamStatusEnumFactory()));
3510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3511        res.getCategory().add(parseCodeableConcept(xpp));
3512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
3513        res.setNameElement(parseString(xpp));
3514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3515        res.setSubject(parseReference(xpp));
3516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3517        res.setContext(parseReference(xpp));
3518      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3519        res.setPeriod(parsePeriod(xpp));
3520      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3521        res.getParticipant().add(parseCareTeamCareTeamParticipantComponent(xpp, res));
3522      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
3523        res.getReasonCode().add(parseCodeableConcept(xpp));
3524      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
3525        res.getReasonReference().add(parseReference(xpp));
3526      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
3527        res.getManagingOrganization().add(parseReference(xpp));
3528      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3529        res.getNote().add(parseAnnotation(xpp));
3530      } else if (!parseDomainResourceContent(eventType, xpp, res))
3531        return false;
3532    return true;
3533  }
3534
3535  protected CareTeam.CareTeamParticipantComponent parseCareTeamCareTeamParticipantComponent(XmlPullParser xpp, CareTeam owner) throws XmlPullParserException, IOException, FHIRFormatError {
3536    CareTeam.CareTeamParticipantComponent res = new CareTeam.CareTeamParticipantComponent();
3537    parseBackboneAttributes(xpp, res);
3538    next(xpp);
3539    int eventType = nextNoWhitespace(xpp);
3540    while (eventType != XmlPullParser.END_TAG) {
3541  if (!parseCareTeamCareTeamParticipantComponentContent(eventType, xpp, owner, res))
3542        unknownContent(xpp);
3543      eventType = nextNoWhitespace(xpp);
3544    }
3545    next(xpp);
3546    parseElementClose(res);
3547    return res;
3548  }
3549
3550  protected boolean parseCareTeamCareTeamParticipantComponentContent(int eventType, XmlPullParser xpp, CareTeam owner, CareTeam.CareTeamParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3551      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3552        res.setRole(parseCodeableConcept(xpp));
3553      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("member")) {
3554        res.setMember(parseReference(xpp));
3555      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
3556        res.setOnBehalfOf(parseReference(xpp));
3557      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
3558        res.setPeriod(parsePeriod(xpp));
3559      } else if (!parseBackboneContent(eventType, xpp, res))
3560        return false;
3561    return true;
3562  }
3563
3564  protected ChargeItem parseChargeItem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3565    ChargeItem res = new ChargeItem();
3566    parseDomainResourceAttributes(xpp, res);
3567    next(xpp);
3568    int eventType = nextNoWhitespace(xpp);
3569    while (eventType != XmlPullParser.END_TAG) {
3570  if (!parseChargeItemContent(eventType, xpp, res))
3571        unknownContent(xpp);
3572      eventType = nextNoWhitespace(xpp);
3573    }
3574    next(xpp);
3575    parseElementClose(res);
3576    return res;
3577  }
3578
3579  protected boolean parseChargeItemContent(int eventType, XmlPullParser xpp, ChargeItem res) throws XmlPullParserException, IOException, FHIRFormatError {
3580      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3581        res.setIdentifier(parseIdentifier(xpp));
3582      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
3583        res.getDefinition().add(parseUri(xpp));
3584      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3585        res.setStatusElement(parseEnumeration(xpp, ChargeItem.ChargeItemStatus.NULL, new ChargeItem.ChargeItemStatusEnumFactory()));
3586      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
3587        res.getPartOf().add(parseReference(xpp));
3588      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3589        res.setCode(parseCodeableConcept(xpp));
3590      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
3591        res.setSubject(parseReference(xpp));
3592      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
3593        res.setContext(parseReference(xpp));
3594      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
3595        res.setOccurrence(parseType("occurrence", xpp));
3596      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
3597        res.getParticipant().add(parseChargeItemChargeItemParticipantComponent(xpp, res));
3598      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performingOrganization")) {
3599        res.setPerformingOrganization(parseReference(xpp));
3600      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestingOrganization")) {
3601        res.setRequestingOrganization(parseReference(xpp));
3602      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
3603        res.setQuantity(parseQuantity(xpp));
3604      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodysite")) {
3605        res.getBodysite().add(parseCodeableConcept(xpp));
3606      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factorOverride")) {
3607        res.setFactorOverrideElement(parseDecimal(xpp));
3608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priceOverride")) {
3609        res.setPriceOverride(parseMoney(xpp));
3610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("overrideReason")) {
3611        res.setOverrideReasonElement(parseString(xpp));
3612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3613        res.setEnterer(parseReference(xpp));
3614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enteredDate")) {
3615        res.setEnteredDateElement(parseDateTime(xpp));
3616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3617        res.getReason().add(parseCodeableConcept(xpp));
3618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
3619        res.getService().add(parseReference(xpp));
3620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
3621        res.getAccount().add(parseReference(xpp));
3622      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
3623        res.getNote().add(parseAnnotation(xpp));
3624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInformation")) {
3625        res.getSupportingInformation().add(parseReference(xpp));
3626      } else if (!parseDomainResourceContent(eventType, xpp, res))
3627        return false;
3628    return true;
3629  }
3630
3631  protected ChargeItem.ChargeItemParticipantComponent parseChargeItemChargeItemParticipantComponent(XmlPullParser xpp, ChargeItem owner) throws XmlPullParserException, IOException, FHIRFormatError {
3632    ChargeItem.ChargeItemParticipantComponent res = new ChargeItem.ChargeItemParticipantComponent();
3633    parseBackboneAttributes(xpp, res);
3634    next(xpp);
3635    int eventType = nextNoWhitespace(xpp);
3636    while (eventType != XmlPullParser.END_TAG) {
3637  if (!parseChargeItemChargeItemParticipantComponentContent(eventType, xpp, owner, res))
3638        unknownContent(xpp);
3639      eventType = nextNoWhitespace(xpp);
3640    }
3641    next(xpp);
3642    parseElementClose(res);
3643    return res;
3644  }
3645
3646  protected boolean parseChargeItemChargeItemParticipantComponentContent(int eventType, XmlPullParser xpp, ChargeItem owner, ChargeItem.ChargeItemParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3647      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3648        res.setRole(parseCodeableConcept(xpp));
3649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
3650        res.setActor(parseReference(xpp));
3651      } else if (!parseBackboneContent(eventType, xpp, res))
3652        return false;
3653    return true;
3654  }
3655
3656  protected Claim parseClaim(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
3657    Claim res = new Claim();
3658    parseDomainResourceAttributes(xpp, res);
3659    next(xpp);
3660    int eventType = nextNoWhitespace(xpp);
3661    while (eventType != XmlPullParser.END_TAG) {
3662  if (!parseClaimContent(eventType, xpp, res))
3663        unknownContent(xpp);
3664      eventType = nextNoWhitespace(xpp);
3665    }
3666    next(xpp);
3667    parseElementClose(res);
3668    return res;
3669  }
3670
3671  protected boolean parseClaimContent(int eventType, XmlPullParser xpp, Claim res) throws XmlPullParserException, IOException, FHIRFormatError {
3672      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
3673        res.getIdentifier().add(parseIdentifier(xpp));
3674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
3675        res.setStatusElement(parseEnumeration(xpp, Claim.ClaimStatus.NULL, new Claim.ClaimStatusEnumFactory()));
3676      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3677        res.setType(parseCodeableConcept(xpp));
3678      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
3679        res.getSubType().add(parseCodeableConcept(xpp));
3680      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
3681        res.setUseElement(parseEnumeration(xpp, Claim.Use.NULL, new Claim.UseEnumFactory()));
3682      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
3683        res.setPatient(parseReference(xpp));
3684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
3685        res.setBillablePeriod(parsePeriod(xpp));
3686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
3687        res.setCreatedElement(parseDateTime(xpp));
3688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
3689        res.setEnterer(parseReference(xpp));
3690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
3691        res.setInsurer(parseReference(xpp));
3692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3693        res.setProvider(parseReference(xpp));
3694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
3695        res.setOrganization(parseReference(xpp));
3696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
3697        res.setPriority(parseCodeableConcept(xpp));
3698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fundsReserve")) {
3699        res.setFundsReserve(parseCodeableConcept(xpp));
3700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
3701        res.getRelated().add(parseClaimRelatedClaimComponent(xpp, res));
3702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
3703        res.setPrescription(parseReference(xpp));
3704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
3705        res.setOriginalPrescription(parseReference(xpp));
3706      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
3707        res.setPayee(parseClaimPayeeComponent(xpp, res));
3708      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
3709        res.setReferral(parseReference(xpp));
3710      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
3711        res.setFacility(parseReference(xpp));
3712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
3713        res.getCareTeam().add(parseClaimCareTeamComponent(xpp, res));
3714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
3715        res.getInformation().add(parseClaimSpecialConditionComponent(xpp, res));
3716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
3717        res.getDiagnosis().add(parseClaimDiagnosisComponent(xpp, res));
3718      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
3719        res.getProcedure().add(parseClaimProcedureComponent(xpp, res));
3720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
3721        res.getInsurance().add(parseClaimInsuranceComponent(xpp, res));
3722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
3723        res.setAccident(parseClaimAccidentComponent(xpp, res));
3724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
3725        res.setEmploymentImpacted(parsePeriod(xpp));
3726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
3727        res.setHospitalization(parsePeriod(xpp));
3728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
3729        res.getItem().add(parseClaimItemComponent(xpp, res));
3730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("total")) {
3731        res.setTotal(parseMoney(xpp));
3732      } else if (!parseDomainResourceContent(eventType, xpp, res))
3733        return false;
3734    return true;
3735  }
3736
3737  protected Claim.RelatedClaimComponent parseClaimRelatedClaimComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3738    Claim.RelatedClaimComponent res = new Claim.RelatedClaimComponent();
3739    parseBackboneAttributes(xpp, res);
3740    next(xpp);
3741    int eventType = nextNoWhitespace(xpp);
3742    while (eventType != XmlPullParser.END_TAG) {
3743  if (!parseClaimRelatedClaimComponentContent(eventType, xpp, owner, res))
3744        unknownContent(xpp);
3745      eventType = nextNoWhitespace(xpp);
3746    }
3747    next(xpp);
3748    parseElementClose(res);
3749    return res;
3750  }
3751
3752  protected boolean parseClaimRelatedClaimComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3753      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
3754        res.setClaim(parseReference(xpp));
3755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
3756        res.setRelationship(parseCodeableConcept(xpp));
3757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
3758        res.setReference(parseIdentifier(xpp));
3759      } else if (!parseBackboneContent(eventType, xpp, res))
3760        return false;
3761    return true;
3762  }
3763
3764  protected Claim.PayeeComponent parseClaimPayeeComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3765    Claim.PayeeComponent res = new Claim.PayeeComponent();
3766    parseBackboneAttributes(xpp, res);
3767    next(xpp);
3768    int eventType = nextNoWhitespace(xpp);
3769    while (eventType != XmlPullParser.END_TAG) {
3770  if (!parseClaimPayeeComponentContent(eventType, xpp, owner, res))
3771        unknownContent(xpp);
3772      eventType = nextNoWhitespace(xpp);
3773    }
3774    next(xpp);
3775    parseElementClose(res);
3776    return res;
3777  }
3778
3779  protected boolean parseClaimPayeeComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3780      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3781        res.setType(parseCodeableConcept(xpp));
3782      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
3783        res.setResourceType(parseCoding(xpp));
3784      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
3785        res.setParty(parseReference(xpp));
3786      } else if (!parseBackboneContent(eventType, xpp, res))
3787        return false;
3788    return true;
3789  }
3790
3791  protected Claim.CareTeamComponent parseClaimCareTeamComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3792    Claim.CareTeamComponent res = new Claim.CareTeamComponent();
3793    parseBackboneAttributes(xpp, res);
3794    next(xpp);
3795    int eventType = nextNoWhitespace(xpp);
3796    while (eventType != XmlPullParser.END_TAG) {
3797  if (!parseClaimCareTeamComponentContent(eventType, xpp, owner, res))
3798        unknownContent(xpp);
3799      eventType = nextNoWhitespace(xpp);
3800    }
3801    next(xpp);
3802    parseElementClose(res);
3803    return res;
3804  }
3805
3806  protected boolean parseClaimCareTeamComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3807      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3808        res.setSequenceElement(parsePositiveInt(xpp));
3809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
3810        res.setProvider(parseReference(xpp));
3811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
3812        res.setResponsibleElement(parseBoolean(xpp));
3813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
3814        res.setRole(parseCodeableConcept(xpp));
3815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
3816        res.setQualification(parseCodeableConcept(xpp));
3817      } else if (!parseBackboneContent(eventType, xpp, res))
3818        return false;
3819    return true;
3820  }
3821
3822  protected Claim.SpecialConditionComponent parseClaimSpecialConditionComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3823    Claim.SpecialConditionComponent res = new Claim.SpecialConditionComponent();
3824    parseBackboneAttributes(xpp, res);
3825    next(xpp);
3826    int eventType = nextNoWhitespace(xpp);
3827    while (eventType != XmlPullParser.END_TAG) {
3828  if (!parseClaimSpecialConditionComponentContent(eventType, xpp, owner, res))
3829        unknownContent(xpp);
3830      eventType = nextNoWhitespace(xpp);
3831    }
3832    next(xpp);
3833    parseElementClose(res);
3834    return res;
3835  }
3836
3837  protected boolean parseClaimSpecialConditionComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SpecialConditionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3838      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3839        res.setSequenceElement(parsePositiveInt(xpp));
3840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
3841        res.setCategory(parseCodeableConcept(xpp));
3842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
3843        res.setCode(parseCodeableConcept(xpp));
3844      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
3845        res.setTiming(parseType("timing", xpp));
3846      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
3847        res.setValue(parseType("value", xpp));
3848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
3849        res.setReason(parseCodeableConcept(xpp));
3850      } else if (!parseBackboneContent(eventType, xpp, res))
3851        return false;
3852    return true;
3853  }
3854
3855  protected Claim.DiagnosisComponent parseClaimDiagnosisComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3856    Claim.DiagnosisComponent res = new Claim.DiagnosisComponent();
3857    parseBackboneAttributes(xpp, res);
3858    next(xpp);
3859    int eventType = nextNoWhitespace(xpp);
3860    while (eventType != XmlPullParser.END_TAG) {
3861  if (!parseClaimDiagnosisComponentContent(eventType, xpp, owner, res))
3862        unknownContent(xpp);
3863      eventType = nextNoWhitespace(xpp);
3864    }
3865    next(xpp);
3866    parseElementClose(res);
3867    return res;
3868  }
3869
3870  protected boolean parseClaimDiagnosisComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3871      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3872        res.setSequenceElement(parsePositiveInt(xpp));
3873      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
3874        res.setDiagnosis(parseType("diagnosis", xpp));
3875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3876        res.getType().add(parseCodeableConcept(xpp));
3877      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
3878        res.setPackageCode(parseCodeableConcept(xpp));
3879      } else if (!parseBackboneContent(eventType, xpp, res))
3880        return false;
3881    return true;
3882  }
3883
3884  protected Claim.ProcedureComponent parseClaimProcedureComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3885    Claim.ProcedureComponent res = new Claim.ProcedureComponent();
3886    parseBackboneAttributes(xpp, res);
3887    next(xpp);
3888    int eventType = nextNoWhitespace(xpp);
3889    while (eventType != XmlPullParser.END_TAG) {
3890  if (!parseClaimProcedureComponentContent(eventType, xpp, owner, res))
3891        unknownContent(xpp);
3892      eventType = nextNoWhitespace(xpp);
3893    }
3894    next(xpp);
3895    parseElementClose(res);
3896    return res;
3897  }
3898
3899  protected boolean parseClaimProcedureComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3900      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3901        res.setSequenceElement(parsePositiveInt(xpp));
3902      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3903        res.setDateElement(parseDateTime(xpp));
3904      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
3905        res.setProcedure(parseType("procedure", xpp));
3906      } else if (!parseBackboneContent(eventType, xpp, res))
3907        return false;
3908    return true;
3909  }
3910
3911  protected Claim.InsuranceComponent parseClaimInsuranceComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3912    Claim.InsuranceComponent res = new Claim.InsuranceComponent();
3913    parseBackboneAttributes(xpp, res);
3914    next(xpp);
3915    int eventType = nextNoWhitespace(xpp);
3916    while (eventType != XmlPullParser.END_TAG) {
3917  if (!parseClaimInsuranceComponentContent(eventType, xpp, owner, res))
3918        unknownContent(xpp);
3919      eventType = nextNoWhitespace(xpp);
3920    }
3921    next(xpp);
3922    parseElementClose(res);
3923    return res;
3924  }
3925
3926  protected boolean parseClaimInsuranceComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3927      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3928        res.setSequenceElement(parsePositiveInt(xpp));
3929      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
3930        res.setFocalElement(parseBoolean(xpp));
3931      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
3932        res.setCoverage(parseReference(xpp));
3933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
3934        res.setBusinessArrangementElement(parseString(xpp));
3935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
3936        res.getPreAuthRef().add(parseString(xpp));
3937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
3938        res.setClaimResponse(parseReference(xpp));
3939      } else if (!parseBackboneContent(eventType, xpp, res))
3940        return false;
3941    return true;
3942  }
3943
3944  protected Claim.AccidentComponent parseClaimAccidentComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3945    Claim.AccidentComponent res = new Claim.AccidentComponent();
3946    parseBackboneAttributes(xpp, res);
3947    next(xpp);
3948    int eventType = nextNoWhitespace(xpp);
3949    while (eventType != XmlPullParser.END_TAG) {
3950  if (!parseClaimAccidentComponentContent(eventType, xpp, owner, res))
3951        unknownContent(xpp);
3952      eventType = nextNoWhitespace(xpp);
3953    }
3954    next(xpp);
3955    parseElementClose(res);
3956    return res;
3957  }
3958
3959  protected boolean parseClaimAccidentComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3960      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
3961        res.setDateElement(parseDate(xpp));
3962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
3963        res.setType(parseCodeableConcept(xpp));
3964      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
3965        res.setLocation(parseType("location", xpp));
3966      } else if (!parseBackboneContent(eventType, xpp, res))
3967        return false;
3968    return true;
3969  }
3970
3971  protected Claim.ItemComponent parseClaimItemComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
3972    Claim.ItemComponent res = new Claim.ItemComponent();
3973    parseBackboneAttributes(xpp, res);
3974    next(xpp);
3975    int eventType = nextNoWhitespace(xpp);
3976    while (eventType != XmlPullParser.END_TAG) {
3977  if (!parseClaimItemComponentContent(eventType, xpp, owner, res))
3978        unknownContent(xpp);
3979      eventType = nextNoWhitespace(xpp);
3980    }
3981    next(xpp);
3982    parseElementClose(res);
3983    return res;
3984  }
3985
3986  protected boolean parseClaimItemComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
3987      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
3988        res.setSequenceElement(parsePositiveInt(xpp));
3989      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
3990        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
3991      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {
3992        res.getDiagnosisLinkId().add(parsePositiveInt(xpp));
3993      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedureLinkId")) {
3994        res.getProcedureLinkId().add(parsePositiveInt(xpp));
3995      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("informationLinkId")) {
3996        res.getInformationLinkId().add(parsePositiveInt(xpp));
3997      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
3998        res.setRevenue(parseCodeableConcept(xpp));
3999      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4000        res.setCategory(parseCodeableConcept(xpp));
4001      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4002        res.setService(parseCodeableConcept(xpp));
4003      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4004        res.getModifier().add(parseCodeableConcept(xpp));
4005      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4006        res.getProgramCode().add(parseCodeableConcept(xpp));
4007      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
4008        res.setServiced(parseType("serviced", xpp));
4009      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
4010        res.setLocation(parseType("location", xpp));
4011      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4012        res.setQuantity(parseSimpleQuantity(xpp));
4013      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4014        res.setUnitPrice(parseMoney(xpp));
4015      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4016        res.setFactorElement(parseDecimal(xpp));
4017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4018        res.setNet(parseMoney(xpp));
4019      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4020        res.getUdi().add(parseReference(xpp));
4021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
4022        res.setBodySite(parseCodeableConcept(xpp));
4023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subSite")) {
4024        res.getSubSite().add(parseCodeableConcept(xpp));
4025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
4026        res.getEncounter().add(parseReference(xpp));
4027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4028        res.getDetail().add(parseClaimDetailComponent(xpp, owner));
4029      } else if (!parseBackboneContent(eventType, xpp, res))
4030        return false;
4031    return true;
4032  }
4033
4034  protected Claim.DetailComponent parseClaimDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4035    Claim.DetailComponent res = new Claim.DetailComponent();
4036    parseBackboneAttributes(xpp, res);
4037    next(xpp);
4038    int eventType = nextNoWhitespace(xpp);
4039    while (eventType != XmlPullParser.END_TAG) {
4040  if (!parseClaimDetailComponentContent(eventType, xpp, owner, res))
4041        unknownContent(xpp);
4042      eventType = nextNoWhitespace(xpp);
4043    }
4044    next(xpp);
4045    parseElementClose(res);
4046    return res;
4047  }
4048
4049  protected boolean parseClaimDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.DetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4050      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4051        res.setSequenceElement(parsePositiveInt(xpp));
4052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4053        res.setRevenue(parseCodeableConcept(xpp));
4054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4055        res.setCategory(parseCodeableConcept(xpp));
4056      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4057        res.setService(parseCodeableConcept(xpp));
4058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4059        res.getModifier().add(parseCodeableConcept(xpp));
4060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4061        res.getProgramCode().add(parseCodeableConcept(xpp));
4062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4063        res.setQuantity(parseSimpleQuantity(xpp));
4064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4065        res.setUnitPrice(parseMoney(xpp));
4066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4067        res.setFactorElement(parseDecimal(xpp));
4068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4069        res.setNet(parseMoney(xpp));
4070      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4071        res.getUdi().add(parseReference(xpp));
4072      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4073        res.getSubDetail().add(parseClaimSubDetailComponent(xpp, owner));
4074      } else if (!parseBackboneContent(eventType, xpp, res))
4075        return false;
4076    return true;
4077  }
4078
4079  protected Claim.SubDetailComponent parseClaimSubDetailComponent(XmlPullParser xpp, Claim owner) throws XmlPullParserException, IOException, FHIRFormatError {
4080    Claim.SubDetailComponent res = new Claim.SubDetailComponent();
4081    parseBackboneAttributes(xpp, res);
4082    next(xpp);
4083    int eventType = nextNoWhitespace(xpp);
4084    while (eventType != XmlPullParser.END_TAG) {
4085  if (!parseClaimSubDetailComponentContent(eventType, xpp, owner, res))
4086        unknownContent(xpp);
4087      eventType = nextNoWhitespace(xpp);
4088    }
4089    next(xpp);
4090    parseElementClose(res);
4091    return res;
4092  }
4093
4094  protected boolean parseClaimSubDetailComponentContent(int eventType, XmlPullParser xpp, Claim owner, Claim.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4095      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4096        res.setSequenceElement(parsePositiveInt(xpp));
4097      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4098        res.setRevenue(parseCodeableConcept(xpp));
4099      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4100        res.setCategory(parseCodeableConcept(xpp));
4101      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4102        res.setService(parseCodeableConcept(xpp));
4103      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4104        res.getModifier().add(parseCodeableConcept(xpp));
4105      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("programCode")) {
4106        res.getProgramCode().add(parseCodeableConcept(xpp));
4107      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
4108        res.setQuantity(parseSimpleQuantity(xpp));
4109      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
4110        res.setUnitPrice(parseMoney(xpp));
4111      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
4112        res.setFactorElement(parseDecimal(xpp));
4113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
4114        res.setNet(parseMoney(xpp));
4115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
4116        res.getUdi().add(parseReference(xpp));
4117      } else if (!parseBackboneContent(eventType, xpp, res))
4118        return false;
4119    return true;
4120  }
4121
4122  protected ClaimResponse parseClaimResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4123    ClaimResponse res = new ClaimResponse();
4124    parseDomainResourceAttributes(xpp, res);
4125    next(xpp);
4126    int eventType = nextNoWhitespace(xpp);
4127    while (eventType != XmlPullParser.END_TAG) {
4128  if (!parseClaimResponseContent(eventType, xpp, res))
4129        unknownContent(xpp);
4130      eventType = nextNoWhitespace(xpp);
4131    }
4132    next(xpp);
4133    parseElementClose(res);
4134    return res;
4135  }
4136
4137  protected boolean parseClaimResponseContent(int eventType, XmlPullParser xpp, ClaimResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
4138      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4139        res.getIdentifier().add(parseIdentifier(xpp));
4140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4141        res.setStatusElement(parseEnumeration(xpp, ClaimResponse.ClaimResponseStatus.NULL, new ClaimResponse.ClaimResponseStatusEnumFactory()));
4142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
4143        res.setPatient(parseReference(xpp));
4144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
4145        res.setCreatedElement(parseDateTime(xpp));
4146      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
4147        res.setInsurer(parseReference(xpp));
4148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
4149        res.setRequestProvider(parseReference(xpp));
4150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
4151        res.setRequestOrganization(parseReference(xpp));
4152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
4153        res.setRequest(parseReference(xpp));
4154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
4155        res.setOutcome(parseCodeableConcept(xpp));
4156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
4157        res.setDispositionElement(parseString(xpp));
4158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payeeType")) {
4159        res.setPayeeType(parseCodeableConcept(xpp));
4160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4161        res.getItem().add(parseClaimResponseItemComponent(xpp, res));
4162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
4163        res.getAddItem().add(parseClaimResponseAddedItemComponent(xpp, res));
4164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
4165        res.getError().add(parseClaimResponseErrorComponent(xpp, res));
4166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
4167        res.setTotalCost(parseMoney(xpp));
4168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
4169        res.setUnallocDeductable(parseMoney(xpp));
4170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
4171        res.setTotalBenefit(parseMoney(xpp));
4172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
4173        res.setPayment(parseClaimResponsePaymentComponent(xpp, res));
4174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reserved")) {
4175        res.setReserved(parseCoding(xpp));
4176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
4177        res.setForm(parseCodeableConcept(xpp));
4178      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
4179        res.getProcessNote().add(parseClaimResponseNoteComponent(xpp, res));
4180      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("communicationRequest")) {
4181        res.getCommunicationRequest().add(parseReference(xpp));
4182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
4183        res.getInsurance().add(parseClaimResponseInsuranceComponent(xpp, res));
4184      } else if (!parseDomainResourceContent(eventType, xpp, res))
4185        return false;
4186    return true;
4187  }
4188
4189  protected ClaimResponse.ItemComponent parseClaimResponseItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4190    ClaimResponse.ItemComponent res = new ClaimResponse.ItemComponent();
4191    parseBackboneAttributes(xpp, res);
4192    next(xpp);
4193    int eventType = nextNoWhitespace(xpp);
4194    while (eventType != XmlPullParser.END_TAG) {
4195  if (!parseClaimResponseItemComponentContent(eventType, xpp, owner, res))
4196        unknownContent(xpp);
4197      eventType = nextNoWhitespace(xpp);
4198    }
4199    next(xpp);
4200    parseElementClose(res);
4201    return res;
4202  }
4203
4204  protected boolean parseClaimResponseItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4205      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4206        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4208        res.getNoteNumber().add(parsePositiveInt(xpp));
4209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4210        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4212        res.getDetail().add(parseClaimResponseItemDetailComponent(xpp, owner));
4213      } else if (!parseBackboneContent(eventType, xpp, res))
4214        return false;
4215    return true;
4216  }
4217
4218  protected ClaimResponse.AdjudicationComponent parseClaimResponseAdjudicationComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4219    ClaimResponse.AdjudicationComponent res = new ClaimResponse.AdjudicationComponent();
4220    parseBackboneAttributes(xpp, res);
4221    next(xpp);
4222    int eventType = nextNoWhitespace(xpp);
4223    while (eventType != XmlPullParser.END_TAG) {
4224  if (!parseClaimResponseAdjudicationComponentContent(eventType, xpp, owner, res))
4225        unknownContent(xpp);
4226      eventType = nextNoWhitespace(xpp);
4227    }
4228    next(xpp);
4229    parseElementClose(res);
4230    return res;
4231  }
4232
4233  protected boolean parseClaimResponseAdjudicationComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AdjudicationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4234      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4235        res.setCategory(parseCodeableConcept(xpp));
4236      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
4237        res.setReason(parseCodeableConcept(xpp));
4238      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4239        res.setAmount(parseMoney(xpp));
4240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4241        res.setValueElement(parseDecimal(xpp));
4242      } else if (!parseBackboneContent(eventType, xpp, res))
4243        return false;
4244    return true;
4245  }
4246
4247  protected ClaimResponse.ItemDetailComponent parseClaimResponseItemDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4248    ClaimResponse.ItemDetailComponent res = new ClaimResponse.ItemDetailComponent();
4249    parseBackboneAttributes(xpp, res);
4250    next(xpp);
4251    int eventType = nextNoWhitespace(xpp);
4252    while (eventType != XmlPullParser.END_TAG) {
4253  if (!parseClaimResponseItemDetailComponentContent(eventType, xpp, owner, res))
4254        unknownContent(xpp);
4255      eventType = nextNoWhitespace(xpp);
4256    }
4257    next(xpp);
4258    parseElementClose(res);
4259    return res;
4260  }
4261
4262  protected boolean parseClaimResponseItemDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ItemDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4263      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4264        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4265      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4266        res.getNoteNumber().add(parsePositiveInt(xpp));
4267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4268        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4269      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subDetail")) {
4270        res.getSubDetail().add(parseClaimResponseSubDetailComponent(xpp, owner));
4271      } else if (!parseBackboneContent(eventType, xpp, res))
4272        return false;
4273    return true;
4274  }
4275
4276  protected ClaimResponse.SubDetailComponent parseClaimResponseSubDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4277    ClaimResponse.SubDetailComponent res = new ClaimResponse.SubDetailComponent();
4278    parseBackboneAttributes(xpp, res);
4279    next(xpp);
4280    int eventType = nextNoWhitespace(xpp);
4281    while (eventType != XmlPullParser.END_TAG) {
4282  if (!parseClaimResponseSubDetailComponentContent(eventType, xpp, owner, res))
4283        unknownContent(xpp);
4284      eventType = nextNoWhitespace(xpp);
4285    }
4286    next(xpp);
4287    parseElementClose(res);
4288    return res;
4289  }
4290
4291  protected boolean parseClaimResponseSubDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.SubDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4292      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4293        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4295        res.getNoteNumber().add(parsePositiveInt(xpp));
4296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4297        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4298      } else if (!parseBackboneContent(eventType, xpp, res))
4299        return false;
4300    return true;
4301  }
4302
4303  protected ClaimResponse.AddedItemComponent parseClaimResponseAddedItemComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4304    ClaimResponse.AddedItemComponent res = new ClaimResponse.AddedItemComponent();
4305    parseBackboneAttributes(xpp, res);
4306    next(xpp);
4307    int eventType = nextNoWhitespace(xpp);
4308    while (eventType != XmlPullParser.END_TAG) {
4309  if (!parseClaimResponseAddedItemComponentContent(eventType, xpp, owner, res))
4310        unknownContent(xpp);
4311      eventType = nextNoWhitespace(xpp);
4312    }
4313    next(xpp);
4314    parseElementClose(res);
4315    return res;
4316  }
4317
4318  protected boolean parseClaimResponseAddedItemComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4319      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4320        res.getSequenceLinkId().add(parsePositiveInt(xpp));
4321      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4322        res.setRevenue(parseCodeableConcept(xpp));
4323      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4324        res.setCategory(parseCodeableConcept(xpp));
4325      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4326        res.setService(parseCodeableConcept(xpp));
4327      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4328        res.getModifier().add(parseCodeableConcept(xpp));
4329      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4330        res.setFee(parseMoney(xpp));
4331      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4332        res.getNoteNumber().add(parsePositiveInt(xpp));
4333      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4334        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4335      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
4336        res.getDetail().add(parseClaimResponseAddedItemsDetailComponent(xpp, owner));
4337      } else if (!parseBackboneContent(eventType, xpp, res))
4338        return false;
4339    return true;
4340  }
4341
4342  protected ClaimResponse.AddedItemsDetailComponent parseClaimResponseAddedItemsDetailComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4343    ClaimResponse.AddedItemsDetailComponent res = new ClaimResponse.AddedItemsDetailComponent();
4344    parseBackboneAttributes(xpp, res);
4345    next(xpp);
4346    int eventType = nextNoWhitespace(xpp);
4347    while (eventType != XmlPullParser.END_TAG) {
4348  if (!parseClaimResponseAddedItemsDetailComponentContent(eventType, xpp, owner, res))
4349        unknownContent(xpp);
4350      eventType = nextNoWhitespace(xpp);
4351    }
4352    next(xpp);
4353    parseElementClose(res);
4354    return res;
4355  }
4356
4357  protected boolean parseClaimResponseAddedItemsDetailComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.AddedItemsDetailComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4358      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("revenue")) {
4359        res.setRevenue(parseCodeableConcept(xpp));
4360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4361        res.setCategory(parseCodeableConcept(xpp));
4362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("service")) {
4363        res.setService(parseCodeableConcept(xpp));
4364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("modifier")) {
4365        res.getModifier().add(parseCodeableConcept(xpp));
4366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fee")) {
4367        res.setFee(parseMoney(xpp));
4368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("noteNumber")) {
4369        res.getNoteNumber().add(parsePositiveInt(xpp));
4370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjudication")) {
4371        res.getAdjudication().add(parseClaimResponseAdjudicationComponent(xpp, owner));
4372      } else if (!parseBackboneContent(eventType, xpp, res))
4373        return false;
4374    return true;
4375  }
4376
4377  protected ClaimResponse.ErrorComponent parseClaimResponseErrorComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4378    ClaimResponse.ErrorComponent res = new ClaimResponse.ErrorComponent();
4379    parseBackboneAttributes(xpp, res);
4380    next(xpp);
4381    int eventType = nextNoWhitespace(xpp);
4382    while (eventType != XmlPullParser.END_TAG) {
4383  if (!parseClaimResponseErrorComponentContent(eventType, xpp, owner, res))
4384        unknownContent(xpp);
4385      eventType = nextNoWhitespace(xpp);
4386    }
4387    next(xpp);
4388    parseElementClose(res);
4389    return res;
4390  }
4391
4392  protected boolean parseClaimResponseErrorComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.ErrorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4393      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequenceLinkId")) {
4394        res.setSequenceLinkIdElement(parsePositiveInt(xpp));
4395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detailSequenceLinkId")) {
4396        res.setDetailSequenceLinkIdElement(parsePositiveInt(xpp));
4397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subdetailSequenceLinkId")) {
4398        res.setSubdetailSequenceLinkIdElement(parsePositiveInt(xpp));
4399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4400        res.setCode(parseCodeableConcept(xpp));
4401      } else if (!parseBackboneContent(eventType, xpp, res))
4402        return false;
4403    return true;
4404  }
4405
4406  protected ClaimResponse.PaymentComponent parseClaimResponsePaymentComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4407    ClaimResponse.PaymentComponent res = new ClaimResponse.PaymentComponent();
4408    parseBackboneAttributes(xpp, res);
4409    next(xpp);
4410    int eventType = nextNoWhitespace(xpp);
4411    while (eventType != XmlPullParser.END_TAG) {
4412  if (!parseClaimResponsePaymentComponentContent(eventType, xpp, owner, res))
4413        unknownContent(xpp);
4414      eventType = nextNoWhitespace(xpp);
4415    }
4416    next(xpp);
4417    parseElementClose(res);
4418    return res;
4419  }
4420
4421  protected boolean parseClaimResponsePaymentComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.PaymentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4422      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4423        res.setType(parseCodeableConcept(xpp));
4424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustment")) {
4425        res.setAdjustment(parseMoney(xpp));
4426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("adjustmentReason")) {
4427        res.setAdjustmentReason(parseCodeableConcept(xpp));
4428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4429        res.setDateElement(parseDate(xpp));
4430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("amount")) {
4431        res.setAmount(parseMoney(xpp));
4432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4433        res.setIdentifier(parseIdentifier(xpp));
4434      } else if (!parseBackboneContent(eventType, xpp, res))
4435        return false;
4436    return true;
4437  }
4438
4439  protected ClaimResponse.NoteComponent parseClaimResponseNoteComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4440    ClaimResponse.NoteComponent res = new ClaimResponse.NoteComponent();
4441    parseBackboneAttributes(xpp, res);
4442    next(xpp);
4443    int eventType = nextNoWhitespace(xpp);
4444    while (eventType != XmlPullParser.END_TAG) {
4445  if (!parseClaimResponseNoteComponentContent(eventType, xpp, owner, res))
4446        unknownContent(xpp);
4447      eventType = nextNoWhitespace(xpp);
4448    }
4449    next(xpp);
4450    parseElementClose(res);
4451    return res;
4452  }
4453
4454  protected boolean parseClaimResponseNoteComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.NoteComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4455      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("number")) {
4456        res.setNumberElement(parsePositiveInt(xpp));
4457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4458        res.setType(parseCodeableConcept(xpp));
4459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
4460        res.setTextElement(parseString(xpp));
4461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4462        res.setLanguage(parseCodeableConcept(xpp));
4463      } else if (!parseBackboneContent(eventType, xpp, res))
4464        return false;
4465    return true;
4466  }
4467
4468  protected ClaimResponse.InsuranceComponent parseClaimResponseInsuranceComponent(XmlPullParser xpp, ClaimResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
4469    ClaimResponse.InsuranceComponent res = new ClaimResponse.InsuranceComponent();
4470    parseBackboneAttributes(xpp, res);
4471    next(xpp);
4472    int eventType = nextNoWhitespace(xpp);
4473    while (eventType != XmlPullParser.END_TAG) {
4474  if (!parseClaimResponseInsuranceComponentContent(eventType, xpp, owner, res))
4475        unknownContent(xpp);
4476      eventType = nextNoWhitespace(xpp);
4477    }
4478    next(xpp);
4479    parseElementClose(res);
4480    return res;
4481  }
4482
4483  protected boolean parseClaimResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, ClaimResponse owner, ClaimResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4484      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
4485        res.setSequenceElement(parsePositiveInt(xpp));
4486      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("focal")) {
4487        res.setFocalElement(parseBoolean(xpp));
4488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
4489        res.setCoverage(parseReference(xpp));
4490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
4491        res.setBusinessArrangementElement(parseString(xpp));
4492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
4493        res.getPreAuthRef().add(parseString(xpp));
4494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
4495        res.setClaimResponse(parseReference(xpp));
4496      } else if (!parseBackboneContent(eventType, xpp, res))
4497        return false;
4498    return true;
4499  }
4500
4501  protected ClinicalImpression parseClinicalImpression(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4502    ClinicalImpression res = new ClinicalImpression();
4503    parseDomainResourceAttributes(xpp, res);
4504    next(xpp);
4505    int eventType = nextNoWhitespace(xpp);
4506    while (eventType != XmlPullParser.END_TAG) {
4507  if (!parseClinicalImpressionContent(eventType, xpp, res))
4508        unknownContent(xpp);
4509      eventType = nextNoWhitespace(xpp);
4510    }
4511    next(xpp);
4512    parseElementClose(res);
4513    return res;
4514  }
4515
4516  protected boolean parseClinicalImpressionContent(int eventType, XmlPullParser xpp, ClinicalImpression res) throws XmlPullParserException, IOException, FHIRFormatError {
4517      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4518        res.getIdentifier().add(parseIdentifier(xpp));
4519      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4520        res.setStatusElement(parseEnumeration(xpp, ClinicalImpression.ClinicalImpressionStatus.NULL, new ClinicalImpression.ClinicalImpressionStatusEnumFactory()));
4521      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4522        res.setCode(parseCodeableConcept(xpp));
4523      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4524        res.setDescriptionElement(parseString(xpp));
4525      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4526        res.setSubject(parseReference(xpp));
4527      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4528        res.setContext(parseReference(xpp));
4529      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
4530        res.setEffective(parseType("effective", xpp));
4531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4532        res.setDateElement(parseDateTime(xpp));
4533      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessor")) {
4534        res.setAssessor(parseReference(xpp));
4535      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("previous")) {
4536        res.setPrevious(parseReference(xpp));
4537      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("problem")) {
4538        res.getProblem().add(parseReference(xpp));
4539      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("investigation")) {
4540        res.getInvestigation().add(parseClinicalImpressionClinicalImpressionInvestigationComponent(xpp, res));
4541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("protocol")) {
4542        res.getProtocol().add(parseUri(xpp));
4543      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
4544        res.setSummaryElement(parseString(xpp));
4545      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("finding")) {
4546        res.getFinding().add(parseClinicalImpressionClinicalImpressionFindingComponent(xpp, res));
4547      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisCodeableConcept")) {
4548        res.getPrognosisCodeableConcept().add(parseCodeableConcept(xpp));
4549      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prognosisReference")) {
4550        res.getPrognosisReference().add(parseReference(xpp));
4551      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
4552        res.getAction().add(parseReference(xpp));
4553      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4554        res.getNote().add(parseAnnotation(xpp));
4555      } else if (!parseDomainResourceContent(eventType, xpp, res))
4556        return false;
4557    return true;
4558  }
4559
4560  protected ClinicalImpression.ClinicalImpressionInvestigationComponent parseClinicalImpressionClinicalImpressionInvestigationComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4561    ClinicalImpression.ClinicalImpressionInvestigationComponent res = new ClinicalImpression.ClinicalImpressionInvestigationComponent();
4562    parseBackboneAttributes(xpp, res);
4563    next(xpp);
4564    int eventType = nextNoWhitespace(xpp);
4565    while (eventType != XmlPullParser.END_TAG) {
4566  if (!parseClinicalImpressionClinicalImpressionInvestigationComponentContent(eventType, xpp, owner, res))
4567        unknownContent(xpp);
4568      eventType = nextNoWhitespace(xpp);
4569    }
4570    next(xpp);
4571    parseElementClose(res);
4572    return res;
4573  }
4574
4575  protected boolean parseClinicalImpressionClinicalImpressionInvestigationComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionInvestigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4576      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4577        res.setCode(parseCodeableConcept(xpp));
4578      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
4579        res.getItem().add(parseReference(xpp));
4580      } else if (!parseBackboneContent(eventType, xpp, res))
4581        return false;
4582    return true;
4583  }
4584
4585  protected ClinicalImpression.ClinicalImpressionFindingComponent parseClinicalImpressionClinicalImpressionFindingComponent(XmlPullParser xpp, ClinicalImpression owner) throws XmlPullParserException, IOException, FHIRFormatError {
4586    ClinicalImpression.ClinicalImpressionFindingComponent res = new ClinicalImpression.ClinicalImpressionFindingComponent();
4587    parseBackboneAttributes(xpp, res);
4588    next(xpp);
4589    int eventType = nextNoWhitespace(xpp);
4590    while (eventType != XmlPullParser.END_TAG) {
4591  if (!parseClinicalImpressionClinicalImpressionFindingComponentContent(eventType, xpp, owner, res))
4592        unknownContent(xpp);
4593      eventType = nextNoWhitespace(xpp);
4594    }
4595    next(xpp);
4596    parseElementClose(res);
4597    return res;
4598  }
4599
4600  protected boolean parseClinicalImpressionClinicalImpressionFindingComponentContent(int eventType, XmlPullParser xpp, ClinicalImpression owner, ClinicalImpression.ClinicalImpressionFindingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4601      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "item")) {
4602        res.setItem(parseType("item", xpp));
4603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basis")) {
4604        res.setBasisElement(parseString(xpp));
4605      } else if (!parseBackboneContent(eventType, xpp, res))
4606        return false;
4607    return true;
4608  }
4609
4610  protected CodeSystem parseCodeSystem(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4611    CodeSystem res = new CodeSystem();
4612    parseDomainResourceAttributes(xpp, res);
4613    next(xpp);
4614    int eventType = nextNoWhitespace(xpp);
4615    while (eventType != XmlPullParser.END_TAG) {
4616  if (!parseCodeSystemContent(eventType, xpp, res))
4617        unknownContent(xpp);
4618      eventType = nextNoWhitespace(xpp);
4619    }
4620    next(xpp);
4621    parseElementClose(res);
4622    return res;
4623  }
4624
4625  protected boolean parseCodeSystemContent(int eventType, XmlPullParser xpp, CodeSystem res) throws XmlPullParserException, IOException, FHIRFormatError {
4626      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
4627        res.setUrlElement(parseUri(xpp));
4628      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4629        res.setIdentifier(parseIdentifier(xpp));
4630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
4631        res.setVersionElement(parseString(xpp));
4632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
4633        res.setNameElement(parseString(xpp));
4634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
4635        res.setTitleElement(parseString(xpp));
4636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4637        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
4638      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
4639        res.setExperimentalElement(parseBoolean(xpp));
4640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
4641        res.setDateElement(parseDateTime(xpp));
4642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
4643        res.setPublisherElement(parseString(xpp));
4644      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
4645        res.getContact().add(parseContactDetail(xpp));
4646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4647        res.setDescriptionElement(parseMarkdown(xpp));
4648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
4649        res.getUseContext().add(parseUsageContext(xpp));
4650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
4651        res.getJurisdiction().add(parseCodeableConcept(xpp));
4652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
4653        res.setPurposeElement(parseMarkdown(xpp));
4654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
4655        res.setCopyrightElement(parseMarkdown(xpp));
4656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("caseSensitive")) {
4657        res.setCaseSensitiveElement(parseBoolean(xpp));
4658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valueSet")) {
4659        res.setValueSetElement(parseUri(xpp));
4660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hierarchyMeaning")) {
4661        res.setHierarchyMeaningElement(parseEnumeration(xpp, CodeSystem.CodeSystemHierarchyMeaning.NULL, new CodeSystem.CodeSystemHierarchyMeaningEnumFactory()));
4662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("compositional")) {
4663        res.setCompositionalElement(parseBoolean(xpp));
4664      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("versionNeeded")) {
4665        res.setVersionNeededElement(parseBoolean(xpp));
4666      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
4667        res.setContentElement(parseEnumeration(xpp, CodeSystem.CodeSystemContentMode.NULL, new CodeSystem.CodeSystemContentModeEnumFactory()));
4668      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("count")) {
4669        res.setCountElement(parseUnsignedInt(xpp));
4670      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("filter")) {
4671        res.getFilter().add(parseCodeSystemCodeSystemFilterComponent(xpp, res));
4672      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4673        res.getProperty().add(parseCodeSystemPropertyComponent(xpp, res));
4674      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4675        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, res));
4676      } else if (!parseDomainResourceContent(eventType, xpp, res))
4677        return false;
4678    return true;
4679  }
4680
4681  protected CodeSystem.CodeSystemFilterComponent parseCodeSystemCodeSystemFilterComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4682    CodeSystem.CodeSystemFilterComponent res = new CodeSystem.CodeSystemFilterComponent();
4683    parseBackboneAttributes(xpp, res);
4684    next(xpp);
4685    int eventType = nextNoWhitespace(xpp);
4686    while (eventType != XmlPullParser.END_TAG) {
4687  if (!parseCodeSystemCodeSystemFilterComponentContent(eventType, xpp, owner, res))
4688        unknownContent(xpp);
4689      eventType = nextNoWhitespace(xpp);
4690    }
4691    next(xpp);
4692    parseElementClose(res);
4693    return res;
4694  }
4695
4696  protected boolean parseCodeSystemCodeSystemFilterComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.CodeSystemFilterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4697      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4698        res.setCodeElement(parseCode(xpp));
4699      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4700        res.setDescriptionElement(parseString(xpp));
4701      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operator")) {
4702        res.getOperator().add(parseEnumeration(xpp, CodeSystem.FilterOperator.NULL, new CodeSystem.FilterOperatorEnumFactory()));
4703      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4704        res.setValueElement(parseString(xpp));
4705      } else if (!parseBackboneContent(eventType, xpp, res))
4706        return false;
4707    return true;
4708  }
4709
4710  protected CodeSystem.PropertyComponent parseCodeSystemPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4711    CodeSystem.PropertyComponent res = new CodeSystem.PropertyComponent();
4712    parseBackboneAttributes(xpp, res);
4713    next(xpp);
4714    int eventType = nextNoWhitespace(xpp);
4715    while (eventType != XmlPullParser.END_TAG) {
4716  if (!parseCodeSystemPropertyComponentContent(eventType, xpp, owner, res))
4717        unknownContent(xpp);
4718      eventType = nextNoWhitespace(xpp);
4719    }
4720    next(xpp);
4721    parseElementClose(res);
4722    return res;
4723  }
4724
4725  protected boolean parseCodeSystemPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.PropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4726      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4727        res.setCodeElement(parseCode(xpp));
4728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
4729        res.setUriElement(parseUri(xpp));
4730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
4731        res.setDescriptionElement(parseString(xpp));
4732      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
4733        res.setTypeElement(parseEnumeration(xpp, CodeSystem.PropertyType.NULL, new CodeSystem.PropertyTypeEnumFactory()));
4734      } else if (!parseBackboneContent(eventType, xpp, res))
4735        return false;
4736    return true;
4737  }
4738
4739  protected CodeSystem.ConceptDefinitionComponent parseCodeSystemConceptDefinitionComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4740    CodeSystem.ConceptDefinitionComponent res = new CodeSystem.ConceptDefinitionComponent();
4741    parseBackboneAttributes(xpp, res);
4742    next(xpp);
4743    int eventType = nextNoWhitespace(xpp);
4744    while (eventType != XmlPullParser.END_TAG) {
4745  if (!parseCodeSystemConceptDefinitionComponentContent(eventType, xpp, owner, res))
4746        unknownContent(xpp);
4747      eventType = nextNoWhitespace(xpp);
4748    }
4749    next(xpp);
4750    parseElementClose(res);
4751    return res;
4752  }
4753
4754  protected boolean parseCodeSystemConceptDefinitionComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4755      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4756        res.setCodeElement(parseCode(xpp));
4757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
4758        res.setDisplayElement(parseString(xpp));
4759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4760        res.setDefinitionElement(parseString(xpp));
4761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
4762        res.getDesignation().add(parseCodeSystemConceptDefinitionDesignationComponent(xpp, owner));
4763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
4764        res.getProperty().add(parseCodeSystemConceptPropertyComponent(xpp, owner));
4765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("concept")) {
4766        res.getConcept().add(parseCodeSystemConceptDefinitionComponent(xpp, owner));
4767      } else if (!parseBackboneContent(eventType, xpp, res))
4768        return false;
4769    return true;
4770  }
4771
4772  protected CodeSystem.ConceptDefinitionDesignationComponent parseCodeSystemConceptDefinitionDesignationComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4773    CodeSystem.ConceptDefinitionDesignationComponent res = new CodeSystem.ConceptDefinitionDesignationComponent();
4774    parseBackboneAttributes(xpp, res);
4775    next(xpp);
4776    int eventType = nextNoWhitespace(xpp);
4777    while (eventType != XmlPullParser.END_TAG) {
4778  if (!parseCodeSystemConceptDefinitionDesignationComponentContent(eventType, xpp, owner, res))
4779        unknownContent(xpp);
4780      eventType = nextNoWhitespace(xpp);
4781    }
4782    next(xpp);
4783    parseElementClose(res);
4784    return res;
4785  }
4786
4787  protected boolean parseCodeSystemConceptDefinitionDesignationComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptDefinitionDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4788      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
4789        res.setLanguageElement(parseCode(xpp));
4790      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
4791        res.setUse(parseCoding(xpp));
4792      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("value")) {
4793        res.setValueElement(parseString(xpp));
4794      } else if (!parseBackboneContent(eventType, xpp, res))
4795        return false;
4796    return true;
4797  }
4798
4799  protected CodeSystem.ConceptPropertyComponent parseCodeSystemConceptPropertyComponent(XmlPullParser xpp, CodeSystem owner) throws XmlPullParserException, IOException, FHIRFormatError {
4800    CodeSystem.ConceptPropertyComponent res = new CodeSystem.ConceptPropertyComponent();
4801    parseBackboneAttributes(xpp, res);
4802    next(xpp);
4803    int eventType = nextNoWhitespace(xpp);
4804    while (eventType != XmlPullParser.END_TAG) {
4805  if (!parseCodeSystemConceptPropertyComponentContent(eventType, xpp, owner, res))
4806        unknownContent(xpp);
4807      eventType = nextNoWhitespace(xpp);
4808    }
4809    next(xpp);
4810    parseElementClose(res);
4811    return res;
4812  }
4813
4814  protected boolean parseCodeSystemConceptPropertyComponentContent(int eventType, XmlPullParser xpp, CodeSystem owner, CodeSystem.ConceptPropertyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4815      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
4816        res.setCodeElement(parseCode(xpp));
4817      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
4818        res.setValue(parseType("value", xpp));
4819      } else if (!parseBackboneContent(eventType, xpp, res))
4820        return false;
4821    return true;
4822  }
4823
4824  protected Communication parseCommunication(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4825    Communication res = new Communication();
4826    parseDomainResourceAttributes(xpp, res);
4827    next(xpp);
4828    int eventType = nextNoWhitespace(xpp);
4829    while (eventType != XmlPullParser.END_TAG) {
4830  if (!parseCommunicationContent(eventType, xpp, res))
4831        unknownContent(xpp);
4832      eventType = nextNoWhitespace(xpp);
4833    }
4834    next(xpp);
4835    parseElementClose(res);
4836    return res;
4837  }
4838
4839  protected boolean parseCommunicationContent(int eventType, XmlPullParser xpp, Communication res) throws XmlPullParserException, IOException, FHIRFormatError {
4840      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4841        res.getIdentifier().add(parseIdentifier(xpp));
4842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
4843        res.getDefinition().add(parseReference(xpp));
4844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4845        res.getBasedOn().add(parseReference(xpp));
4846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
4847        res.getPartOf().add(parseReference(xpp));
4848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4849        res.setStatusElement(parseEnumeration(xpp, Communication.CommunicationStatus.NULL, new Communication.CommunicationStatusEnumFactory()));
4850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDone")) {
4851        res.setNotDoneElement(parseBoolean(xpp));
4852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("notDoneReason")) {
4853        res.setNotDoneReason(parseCodeableConcept(xpp));
4854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4855        res.getCategory().add(parseCodeableConcept(xpp));
4856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4857        res.getMedium().add(parseCodeableConcept(xpp));
4858      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4859        res.setSubject(parseReference(xpp));
4860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4861        res.getRecipient().add(parseReference(xpp));
4862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4863        res.getTopic().add(parseReference(xpp));
4864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4865        res.setContext(parseReference(xpp));
4866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sent")) {
4867        res.setSentElement(parseDateTime(xpp));
4868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("received")) {
4869        res.setReceivedElement(parseDateTime(xpp));
4870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4871        res.setSender(parseReference(xpp));
4872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4873        res.getReasonCode().add(parseCodeableConcept(xpp));
4874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4875        res.getReasonReference().add(parseReference(xpp));
4876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4877        res.getPayload().add(parseCommunicationCommunicationPayloadComponent(xpp, res));
4878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4879        res.getNote().add(parseAnnotation(xpp));
4880      } else if (!parseDomainResourceContent(eventType, xpp, res))
4881        return false;
4882    return true;
4883  }
4884
4885  protected Communication.CommunicationPayloadComponent parseCommunicationCommunicationPayloadComponent(XmlPullParser xpp, Communication owner) throws XmlPullParserException, IOException, FHIRFormatError {
4886    Communication.CommunicationPayloadComponent res = new Communication.CommunicationPayloadComponent();
4887    parseBackboneAttributes(xpp, res);
4888    next(xpp);
4889    int eventType = nextNoWhitespace(xpp);
4890    while (eventType != XmlPullParser.END_TAG) {
4891  if (!parseCommunicationCommunicationPayloadComponentContent(eventType, xpp, owner, res))
4892        unknownContent(xpp);
4893      eventType = nextNoWhitespace(xpp);
4894    }
4895    next(xpp);
4896    parseElementClose(res);
4897    return res;
4898  }
4899
4900  protected boolean parseCommunicationCommunicationPayloadComponentContent(int eventType, XmlPullParser xpp, Communication owner, Communication.CommunicationPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4901      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4902        res.setContent(parseType("content", xpp));
4903      } else if (!parseBackboneContent(eventType, xpp, res))
4904        return false;
4905    return true;
4906  }
4907
4908  protected CommunicationRequest parseCommunicationRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
4909    CommunicationRequest res = new CommunicationRequest();
4910    parseDomainResourceAttributes(xpp, res);
4911    next(xpp);
4912    int eventType = nextNoWhitespace(xpp);
4913    while (eventType != XmlPullParser.END_TAG) {
4914  if (!parseCommunicationRequestContent(eventType, xpp, res))
4915        unknownContent(xpp);
4916      eventType = nextNoWhitespace(xpp);
4917    }
4918    next(xpp);
4919    parseElementClose(res);
4920    return res;
4921  }
4922
4923  protected boolean parseCommunicationRequestContent(int eventType, XmlPullParser xpp, CommunicationRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
4924      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
4925        res.getIdentifier().add(parseIdentifier(xpp));
4926      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
4927        res.getBasedOn().add(parseReference(xpp));
4928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("replaces")) {
4929        res.getReplaces().add(parseReference(xpp));
4930      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
4931        res.setGroupIdentifier(parseIdentifier(xpp));
4932      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
4933        res.setStatusElement(parseEnumeration(xpp, CommunicationRequest.CommunicationRequestStatus.NULL, new CommunicationRequest.CommunicationRequestStatusEnumFactory()));
4934      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
4935        res.getCategory().add(parseCodeableConcept(xpp));
4936      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
4937        res.setPriorityElement(parseEnumeration(xpp, CommunicationRequest.CommunicationPriority.NULL, new CommunicationRequest.CommunicationPriorityEnumFactory()));
4938      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("medium")) {
4939        res.getMedium().add(parseCodeableConcept(xpp));
4940      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
4941        res.setSubject(parseReference(xpp));
4942      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
4943        res.getRecipient().add(parseReference(xpp));
4944      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
4945        res.getTopic().add(parseReference(xpp));
4946      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
4947        res.setContext(parseReference(xpp));
4948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payload")) {
4949        res.getPayload().add(parseCommunicationRequestCommunicationRequestPayloadComponent(xpp, res));
4950      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
4951        res.setOccurrence(parseType("occurrence", xpp));
4952      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
4953        res.setAuthoredOnElement(parseDateTime(xpp));
4954      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sender")) {
4955        res.setSender(parseReference(xpp));
4956      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
4957        res.setRequester(parseCommunicationRequestCommunicationRequestRequesterComponent(xpp, res));
4958      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
4959        res.getReasonCode().add(parseCodeableConcept(xpp));
4960      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
4961        res.getReasonReference().add(parseReference(xpp));
4962      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
4963        res.getNote().add(parseAnnotation(xpp));
4964      } else if (!parseDomainResourceContent(eventType, xpp, res))
4965        return false;
4966    return true;
4967  }
4968
4969  protected CommunicationRequest.CommunicationRequestPayloadComponent parseCommunicationRequestCommunicationRequestPayloadComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4970    CommunicationRequest.CommunicationRequestPayloadComponent res = new CommunicationRequest.CommunicationRequestPayloadComponent();
4971    parseBackboneAttributes(xpp, res);
4972    next(xpp);
4973    int eventType = nextNoWhitespace(xpp);
4974    while (eventType != XmlPullParser.END_TAG) {
4975  if (!parseCommunicationRequestCommunicationRequestPayloadComponentContent(eventType, xpp, owner, res))
4976        unknownContent(xpp);
4977      eventType = nextNoWhitespace(xpp);
4978    }
4979    next(xpp);
4980    parseElementClose(res);
4981    return res;
4982  }
4983
4984  protected boolean parseCommunicationRequestCommunicationRequestPayloadComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestPayloadComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
4985      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
4986        res.setContent(parseType("content", xpp));
4987      } else if (!parseBackboneContent(eventType, xpp, res))
4988        return false;
4989    return true;
4990  }
4991
4992  protected CommunicationRequest.CommunicationRequestRequesterComponent parseCommunicationRequestCommunicationRequestRequesterComponent(XmlPullParser xpp, CommunicationRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
4993    CommunicationRequest.CommunicationRequestRequesterComponent res = new CommunicationRequest.CommunicationRequestRequesterComponent();
4994    parseBackboneAttributes(xpp, res);
4995    next(xpp);
4996    int eventType = nextNoWhitespace(xpp);
4997    while (eventType != XmlPullParser.END_TAG) {
4998  if (!parseCommunicationRequestCommunicationRequestRequesterComponentContent(eventType, xpp, owner, res))
4999        unknownContent(xpp);
5000      eventType = nextNoWhitespace(xpp);
5001    }
5002    next(xpp);
5003    parseElementClose(res);
5004    return res;
5005  }
5006
5007  protected boolean parseCommunicationRequestCommunicationRequestRequesterComponentContent(int eventType, XmlPullParser xpp, CommunicationRequest owner, CommunicationRequest.CommunicationRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5008      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5009        res.setAgent(parseReference(xpp));
5010      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
5011        res.setOnBehalfOf(parseReference(xpp));
5012      } else if (!parseBackboneContent(eventType, xpp, res))
5013        return false;
5014    return true;
5015  }
5016
5017  protected CompartmentDefinition parseCompartmentDefinition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5018    CompartmentDefinition res = new CompartmentDefinition();
5019    parseDomainResourceAttributes(xpp, res);
5020    next(xpp);
5021    int eventType = nextNoWhitespace(xpp);
5022    while (eventType != XmlPullParser.END_TAG) {
5023  if (!parseCompartmentDefinitionContent(eventType, xpp, res))
5024        unknownContent(xpp);
5025      eventType = nextNoWhitespace(xpp);
5026    }
5027    next(xpp);
5028    parseElementClose(res);
5029    return res;
5030  }
5031
5032  protected boolean parseCompartmentDefinitionContent(int eventType, XmlPullParser xpp, CompartmentDefinition res) throws XmlPullParserException, IOException, FHIRFormatError {
5033      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5034        res.setUrlElement(parseUri(xpp));
5035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5036        res.setNameElement(parseString(xpp));
5037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5038        res.setTitleElement(parseString(xpp));
5039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5040        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5042        res.setExperimentalElement(parseBoolean(xpp));
5043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5044        res.setDateElement(parseDateTime(xpp));
5045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5046        res.setPublisherElement(parseString(xpp));
5047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5048        res.getContact().add(parseContactDetail(xpp));
5049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5050        res.setDescriptionElement(parseMarkdown(xpp));
5051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5052        res.setPurposeElement(parseMarkdown(xpp));
5053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5054        res.getUseContext().add(parseUsageContext(xpp));
5055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5056        res.getJurisdiction().add(parseCodeableConcept(xpp));
5057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5058        res.setCodeElement(parseEnumeration(xpp, CompartmentDefinition.CompartmentType.NULL, new CompartmentDefinition.CompartmentTypeEnumFactory()));
5059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("search")) {
5060        res.setSearchElement(parseBoolean(xpp));
5061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resource")) {
5062        res.getResource().add(parseCompartmentDefinitionCompartmentDefinitionResourceComponent(xpp, res));
5063      } else if (!parseDomainResourceContent(eventType, xpp, res))
5064        return false;
5065    return true;
5066  }
5067
5068  protected CompartmentDefinition.CompartmentDefinitionResourceComponent parseCompartmentDefinitionCompartmentDefinitionResourceComponent(XmlPullParser xpp, CompartmentDefinition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5069    CompartmentDefinition.CompartmentDefinitionResourceComponent res = new CompartmentDefinition.CompartmentDefinitionResourceComponent();
5070    parseBackboneAttributes(xpp, res);
5071    next(xpp);
5072    int eventType = nextNoWhitespace(xpp);
5073    while (eventType != XmlPullParser.END_TAG) {
5074  if (!parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(eventType, xpp, owner, res))
5075        unknownContent(xpp);
5076      eventType = nextNoWhitespace(xpp);
5077    }
5078    next(xpp);
5079    parseElementClose(res);
5080    return res;
5081  }
5082
5083  protected boolean parseCompartmentDefinitionCompartmentDefinitionResourceComponentContent(int eventType, XmlPullParser xpp, CompartmentDefinition owner, CompartmentDefinition.CompartmentDefinitionResourceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5084      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5085        res.setCodeElement(parseCode(xpp));
5086      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("param")) {
5087        res.getParam().add(parseString(xpp));
5088      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("documentation")) {
5089        res.setDocumentationElement(parseString(xpp));
5090      } else if (!parseBackboneContent(eventType, xpp, res))
5091        return false;
5092    return true;
5093  }
5094
5095  protected Composition parseComposition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5096    Composition res = new Composition();
5097    parseDomainResourceAttributes(xpp, res);
5098    next(xpp);
5099    int eventType = nextNoWhitespace(xpp);
5100    while (eventType != XmlPullParser.END_TAG) {
5101  if (!parseCompositionContent(eventType, xpp, res))
5102        unknownContent(xpp);
5103      eventType = nextNoWhitespace(xpp);
5104    }
5105    next(xpp);
5106    parseElementClose(res);
5107    return res;
5108  }
5109
5110  protected boolean parseCompositionContent(int eventType, XmlPullParser xpp, Composition res) throws XmlPullParserException, IOException, FHIRFormatError {
5111      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5112        res.setIdentifier(parseIdentifier(xpp));
5113      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5114        res.setStatusElement(parseEnumeration(xpp, Composition.CompositionStatus.NULL, new Composition.CompositionStatusEnumFactory()));
5115      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5116        res.setType(parseCodeableConcept(xpp));
5117      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5118        res.setClass_(parseCodeableConcept(xpp));
5119      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5120        res.setSubject(parseReference(xpp));
5121      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
5122        res.setEncounter(parseReference(xpp));
5123      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5124        res.setDateElement(parseDateTime(xpp));
5125      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
5126        res.getAuthor().add(parseReference(xpp));
5127      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5128        res.setTitleElement(parseString(xpp));
5129      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("confidentiality")) {
5130        res.setConfidentialityElement(parseEnumeration(xpp, Composition.DocumentConfidentiality.NULL, new Composition.DocumentConfidentialityEnumFactory()));
5131      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attester")) {
5132        res.getAttester().add(parseCompositionCompositionAttesterComponent(xpp, res));
5133      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
5134        res.setCustodian(parseReference(xpp));
5135      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
5136        res.getRelatesTo().add(parseCompositionCompositionRelatesToComponent(xpp, res));
5137      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
5138        res.getEvent().add(parseCompositionCompositionEventComponent(xpp, res));
5139      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5140        res.getSection().add(parseCompositionSectionComponent(xpp, res));
5141      } else if (!parseDomainResourceContent(eventType, xpp, res))
5142        return false;
5143    return true;
5144  }
5145
5146  protected Composition.CompositionAttesterComponent parseCompositionCompositionAttesterComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5147    Composition.CompositionAttesterComponent res = new Composition.CompositionAttesterComponent();
5148    parseBackboneAttributes(xpp, res);
5149    next(xpp);
5150    int eventType = nextNoWhitespace(xpp);
5151    while (eventType != XmlPullParser.END_TAG) {
5152  if (!parseCompositionCompositionAttesterComponentContent(eventType, xpp, owner, res))
5153        unknownContent(xpp);
5154      eventType = nextNoWhitespace(xpp);
5155    }
5156    next(xpp);
5157    parseElementClose(res);
5158    return res;
5159  }
5160
5161  protected boolean parseCompositionCompositionAttesterComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionAttesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5162      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5163        res.getMode().add(parseEnumeration(xpp, Composition.CompositionAttestationMode.NULL, new Composition.CompositionAttestationModeEnumFactory()));
5164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
5165        res.setTimeElement(parseDateTime(xpp));
5166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5167        res.setParty(parseReference(xpp));
5168      } else if (!parseBackboneContent(eventType, xpp, res))
5169        return false;
5170    return true;
5171  }
5172
5173  protected Composition.CompositionRelatesToComponent parseCompositionCompositionRelatesToComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5174    Composition.CompositionRelatesToComponent res = new Composition.CompositionRelatesToComponent();
5175    parseBackboneAttributes(xpp, res);
5176    next(xpp);
5177    int eventType = nextNoWhitespace(xpp);
5178    while (eventType != XmlPullParser.END_TAG) {
5179  if (!parseCompositionCompositionRelatesToComponentContent(eventType, xpp, owner, res))
5180        unknownContent(xpp);
5181      eventType = nextNoWhitespace(xpp);
5182    }
5183    next(xpp);
5184    parseElementClose(res);
5185    return res;
5186  }
5187
5188  protected boolean parseCompositionCompositionRelatesToComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5189      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5190        res.setCodeElement(parseEnumeration(xpp, Composition.DocumentRelationshipType.NULL, new Composition.DocumentRelationshipTypeEnumFactory()));
5191      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5192        res.setTarget(parseType("target", xpp));
5193      } else if (!parseBackboneContent(eventType, xpp, res))
5194        return false;
5195    return true;
5196  }
5197
5198  protected Composition.CompositionEventComponent parseCompositionCompositionEventComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5199    Composition.CompositionEventComponent res = new Composition.CompositionEventComponent();
5200    parseBackboneAttributes(xpp, res);
5201    next(xpp);
5202    int eventType = nextNoWhitespace(xpp);
5203    while (eventType != XmlPullParser.END_TAG) {
5204  if (!parseCompositionCompositionEventComponentContent(eventType, xpp, owner, res))
5205        unknownContent(xpp);
5206      eventType = nextNoWhitespace(xpp);
5207    }
5208    next(xpp);
5209    parseElementClose(res);
5210    return res;
5211  }
5212
5213  protected boolean parseCompositionCompositionEventComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.CompositionEventComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5214      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5215        res.getCode().add(parseCodeableConcept(xpp));
5216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5217        res.setPeriod(parsePeriod(xpp));
5218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5219        res.getDetail().add(parseReference(xpp));
5220      } else if (!parseBackboneContent(eventType, xpp, res))
5221        return false;
5222    return true;
5223  }
5224
5225  protected Composition.SectionComponent parseCompositionSectionComponent(XmlPullParser xpp, Composition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5226    Composition.SectionComponent res = new Composition.SectionComponent();
5227    parseBackboneAttributes(xpp, res);
5228    next(xpp);
5229    int eventType = nextNoWhitespace(xpp);
5230    while (eventType != XmlPullParser.END_TAG) {
5231  if (!parseCompositionSectionComponentContent(eventType, xpp, owner, res))
5232        unknownContent(xpp);
5233      eventType = nextNoWhitespace(xpp);
5234    }
5235    next(xpp);
5236    parseElementClose(res);
5237    return res;
5238  }
5239
5240  protected boolean parseCompositionSectionComponentContent(int eventType, XmlPullParser xpp, Composition owner, Composition.SectionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5241      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5242        res.setTitleElement(parseString(xpp));
5243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5244        res.setCode(parseCodeableConcept(xpp));
5245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5246        res.setText(parseNarrative(xpp));
5247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5248        res.setModeElement(parseEnumeration(xpp, Composition.SectionMode.NULL, new Composition.SectionModeEnumFactory()));
5249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("orderedBy")) {
5250        res.setOrderedBy(parseCodeableConcept(xpp));
5251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entry")) {
5252        res.getEntry().add(parseReference(xpp));
5253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("emptyReason")) {
5254        res.setEmptyReason(parseCodeableConcept(xpp));
5255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("section")) {
5256        res.getSection().add(parseCompositionSectionComponent(xpp, owner));
5257      } else if (!parseBackboneContent(eventType, xpp, res))
5258        return false;
5259    return true;
5260  }
5261
5262  protected ConceptMap parseConceptMap(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5263    ConceptMap res = new ConceptMap();
5264    parseDomainResourceAttributes(xpp, res);
5265    next(xpp);
5266    int eventType = nextNoWhitespace(xpp);
5267    while (eventType != XmlPullParser.END_TAG) {
5268  if (!parseConceptMapContent(eventType, xpp, res))
5269        unknownContent(xpp);
5270      eventType = nextNoWhitespace(xpp);
5271    }
5272    next(xpp);
5273    parseElementClose(res);
5274    return res;
5275  }
5276
5277  protected boolean parseConceptMapContent(int eventType, XmlPullParser xpp, ConceptMap res) throws XmlPullParserException, IOException, FHIRFormatError {
5278      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5279        res.setUrlElement(parseUri(xpp));
5280      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5281        res.setIdentifier(parseIdentifier(xpp));
5282      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
5283        res.setVersionElement(parseString(xpp));
5284      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
5285        res.setNameElement(parseString(xpp));
5286      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
5287        res.setTitleElement(parseString(xpp));
5288      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5289        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
5290      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
5291        res.setExperimentalElement(parseBoolean(xpp));
5292      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
5293        res.setDateElement(parseDateTime(xpp));
5294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
5295        res.setPublisherElement(parseString(xpp));
5296      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
5297        res.getContact().add(parseContactDetail(xpp));
5298      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
5299        res.setDescriptionElement(parseMarkdown(xpp));
5300      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
5301        res.getUseContext().add(parseUsageContext(xpp));
5302      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
5303        res.getJurisdiction().add(parseCodeableConcept(xpp));
5304      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5305        res.setPurposeElement(parseMarkdown(xpp));
5306      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
5307        res.setCopyrightElement(parseMarkdown(xpp));
5308      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5309        res.setSource(parseType("source", xpp));
5310      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "target")) {
5311        res.setTarget(parseType("target", xpp));
5312      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5313        res.getGroup().add(parseConceptMapConceptMapGroupComponent(xpp, res));
5314      } else if (!parseDomainResourceContent(eventType, xpp, res))
5315        return false;
5316    return true;
5317  }
5318
5319  protected ConceptMap.ConceptMapGroupComponent parseConceptMapConceptMapGroupComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5320    ConceptMap.ConceptMapGroupComponent res = new ConceptMap.ConceptMapGroupComponent();
5321    parseBackboneAttributes(xpp, res);
5322    next(xpp);
5323    int eventType = nextNoWhitespace(xpp);
5324    while (eventType != XmlPullParser.END_TAG) {
5325  if (!parseConceptMapConceptMapGroupComponentContent(eventType, xpp, owner, res))
5326        unknownContent(xpp);
5327      eventType = nextNoWhitespace(xpp);
5328    }
5329    next(xpp);
5330    parseElementClose(res);
5331    return res;
5332  }
5333
5334  protected boolean parseConceptMapConceptMapGroupComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5335      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
5336        res.setSourceElement(parseUri(xpp));
5337      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourceVersion")) {
5338        res.setSourceVersionElement(parseString(xpp));
5339      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5340        res.setTargetElement(parseUri(xpp));
5341      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("targetVersion")) {
5342        res.setTargetVersionElement(parseString(xpp));
5343      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
5344        res.getElement().add(parseConceptMapSourceElementComponent(xpp, owner));
5345      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unmapped")) {
5346        res.setUnmapped(parseConceptMapConceptMapGroupUnmappedComponent(xpp, owner));
5347      } else if (!parseBackboneContent(eventType, xpp, res))
5348        return false;
5349    return true;
5350  }
5351
5352  protected ConceptMap.SourceElementComponent parseConceptMapSourceElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5353    ConceptMap.SourceElementComponent res = new ConceptMap.SourceElementComponent();
5354    parseBackboneAttributes(xpp, res);
5355    next(xpp);
5356    int eventType = nextNoWhitespace(xpp);
5357    while (eventType != XmlPullParser.END_TAG) {
5358  if (!parseConceptMapSourceElementComponentContent(eventType, xpp, owner, res))
5359        unknownContent(xpp);
5360      eventType = nextNoWhitespace(xpp);
5361    }
5362    next(xpp);
5363    parseElementClose(res);
5364    return res;
5365  }
5366
5367  protected boolean parseConceptMapSourceElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.SourceElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5368      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5369        res.setCodeElement(parseCode(xpp));
5370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5371        res.setDisplayElement(parseString(xpp));
5372      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
5373        res.getTarget().add(parseConceptMapTargetElementComponent(xpp, owner));
5374      } else if (!parseBackboneContent(eventType, xpp, res))
5375        return false;
5376    return true;
5377  }
5378
5379  protected ConceptMap.TargetElementComponent parseConceptMapTargetElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5380    ConceptMap.TargetElementComponent res = new ConceptMap.TargetElementComponent();
5381    parseBackboneAttributes(xpp, res);
5382    next(xpp);
5383    int eventType = nextNoWhitespace(xpp);
5384    while (eventType != XmlPullParser.END_TAG) {
5385  if (!parseConceptMapTargetElementComponentContent(eventType, xpp, owner, res))
5386        unknownContent(xpp);
5387      eventType = nextNoWhitespace(xpp);
5388    }
5389    next(xpp);
5390    parseElementClose(res);
5391    return res;
5392  }
5393
5394  protected boolean parseConceptMapTargetElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.TargetElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5395      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5396        res.setCodeElement(parseCode(xpp));
5397      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5398        res.setDisplayElement(parseString(xpp));
5399      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("equivalence")) {
5400        res.setEquivalenceElement(parseEnumeration(xpp, Enumerations.ConceptMapEquivalence.NULL, new Enumerations.ConceptMapEquivalenceEnumFactory()));
5401      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
5402        res.setCommentElement(parseString(xpp));
5403      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependsOn")) {
5404        res.getDependsOn().add(parseConceptMapOtherElementComponent(xpp, owner));
5405      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("product")) {
5406        res.getProduct().add(parseConceptMapOtherElementComponent(xpp, owner));
5407      } else if (!parseBackboneContent(eventType, xpp, res))
5408        return false;
5409    return true;
5410  }
5411
5412  protected ConceptMap.OtherElementComponent parseConceptMapOtherElementComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5413    ConceptMap.OtherElementComponent res = new ConceptMap.OtherElementComponent();
5414    parseBackboneAttributes(xpp, res);
5415    next(xpp);
5416    int eventType = nextNoWhitespace(xpp);
5417    while (eventType != XmlPullParser.END_TAG) {
5418  if (!parseConceptMapOtherElementComponentContent(eventType, xpp, owner, res))
5419        unknownContent(xpp);
5420      eventType = nextNoWhitespace(xpp);
5421    }
5422    next(xpp);
5423    parseElementClose(res);
5424    return res;
5425  }
5426
5427  protected boolean parseConceptMapOtherElementComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.OtherElementComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5428      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("property")) {
5429        res.setPropertyElement(parseUri(xpp));
5430      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
5431        res.setSystemElement(parseUri(xpp));
5432      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5433        res.setCodeElement(parseString(xpp));
5434      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5435        res.setDisplayElement(parseString(xpp));
5436      } else if (!parseBackboneContent(eventType, xpp, res))
5437        return false;
5438    return true;
5439  }
5440
5441  protected ConceptMap.ConceptMapGroupUnmappedComponent parseConceptMapConceptMapGroupUnmappedComponent(XmlPullParser xpp, ConceptMap owner) throws XmlPullParserException, IOException, FHIRFormatError {
5442    ConceptMap.ConceptMapGroupUnmappedComponent res = new ConceptMap.ConceptMapGroupUnmappedComponent();
5443    parseBackboneAttributes(xpp, res);
5444    next(xpp);
5445    int eventType = nextNoWhitespace(xpp);
5446    while (eventType != XmlPullParser.END_TAG) {
5447  if (!parseConceptMapConceptMapGroupUnmappedComponentContent(eventType, xpp, owner, res))
5448        unknownContent(xpp);
5449      eventType = nextNoWhitespace(xpp);
5450    }
5451    next(xpp);
5452    parseElementClose(res);
5453    return res;
5454  }
5455
5456  protected boolean parseConceptMapConceptMapGroupUnmappedComponentContent(int eventType, XmlPullParser xpp, ConceptMap owner, ConceptMap.ConceptMapGroupUnmappedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5457      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
5458        res.setModeElement(parseEnumeration(xpp, ConceptMap.ConceptMapGroupUnmappedMode.NULL, new ConceptMap.ConceptMapGroupUnmappedModeEnumFactory()));
5459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5460        res.setCodeElement(parseCode(xpp));
5461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("display")) {
5462        res.setDisplayElement(parseString(xpp));
5463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
5464        res.setUrlElement(parseUri(xpp));
5465      } else if (!parseBackboneContent(eventType, xpp, res))
5466        return false;
5467    return true;
5468  }
5469
5470  protected Condition parseCondition(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5471    Condition res = new Condition();
5472    parseDomainResourceAttributes(xpp, res);
5473    next(xpp);
5474    int eventType = nextNoWhitespace(xpp);
5475    while (eventType != XmlPullParser.END_TAG) {
5476  if (!parseConditionContent(eventType, xpp, res))
5477        unknownContent(xpp);
5478      eventType = nextNoWhitespace(xpp);
5479    }
5480    next(xpp);
5481    parseElementClose(res);
5482    return res;
5483  }
5484
5485  protected boolean parseConditionContent(int eventType, XmlPullParser xpp, Condition res) throws XmlPullParserException, IOException, FHIRFormatError {
5486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5487        res.getIdentifier().add(parseIdentifier(xpp));
5488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("clinicalStatus")) {
5489        res.setClinicalStatusElement(parseEnumeration(xpp, Condition.ConditionClinicalStatus.NULL, new Condition.ConditionClinicalStatusEnumFactory()));
5490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("verificationStatus")) {
5491        res.setVerificationStatusElement(parseEnumeration(xpp, Condition.ConditionVerificationStatus.NULL, new Condition.ConditionVerificationStatusEnumFactory()));
5492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5493        res.getCategory().add(parseCodeableConcept(xpp));
5494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
5495        res.setSeverity(parseCodeableConcept(xpp));
5496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5497        res.setCode(parseCodeableConcept(xpp));
5498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
5499        res.getBodySite().add(parseCodeableConcept(xpp));
5500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5501        res.setSubject(parseReference(xpp));
5502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
5503        res.setContext(parseReference(xpp));
5504      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "onset")) {
5505        res.setOnset(parseType("onset", xpp));
5506      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "abatement")) {
5507        res.setAbatement(parseType("abatement", xpp));
5508      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assertedDate")) {
5509        res.setAssertedDateElement(parseDateTime(xpp));
5510      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("asserter")) {
5511        res.setAsserter(parseReference(xpp));
5512      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stage")) {
5513        res.setStage(parseConditionConditionStageComponent(xpp, res));
5514      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("evidence")) {
5515        res.getEvidence().add(parseConditionConditionEvidenceComponent(xpp, res));
5516      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
5517        res.getNote().add(parseAnnotation(xpp));
5518      } else if (!parseDomainResourceContent(eventType, xpp, res))
5519        return false;
5520    return true;
5521  }
5522
5523  protected Condition.ConditionStageComponent parseConditionConditionStageComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5524    Condition.ConditionStageComponent res = new Condition.ConditionStageComponent();
5525    parseBackboneAttributes(xpp, res);
5526    next(xpp);
5527    int eventType = nextNoWhitespace(xpp);
5528    while (eventType != XmlPullParser.END_TAG) {
5529  if (!parseConditionConditionStageComponentContent(eventType, xpp, owner, res))
5530        unknownContent(xpp);
5531      eventType = nextNoWhitespace(xpp);
5532    }
5533    next(xpp);
5534    parseElementClose(res);
5535    return res;
5536  }
5537
5538  protected boolean parseConditionConditionStageComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionStageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5539      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("summary")) {
5540        res.setSummary(parseCodeableConcept(xpp));
5541      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("assessment")) {
5542        res.getAssessment().add(parseReference(xpp));
5543      } else if (!parseBackboneContent(eventType, xpp, res))
5544        return false;
5545    return true;
5546  }
5547
5548  protected Condition.ConditionEvidenceComponent parseConditionConditionEvidenceComponent(XmlPullParser xpp, Condition owner) throws XmlPullParserException, IOException, FHIRFormatError {
5549    Condition.ConditionEvidenceComponent res = new Condition.ConditionEvidenceComponent();
5550    parseBackboneAttributes(xpp, res);
5551    next(xpp);
5552    int eventType = nextNoWhitespace(xpp);
5553    while (eventType != XmlPullParser.END_TAG) {
5554  if (!parseConditionConditionEvidenceComponentContent(eventType, xpp, owner, res))
5555        unknownContent(xpp);
5556      eventType = nextNoWhitespace(xpp);
5557    }
5558    next(xpp);
5559    parseElementClose(res);
5560    return res;
5561  }
5562
5563  protected boolean parseConditionConditionEvidenceComponentContent(int eventType, XmlPullParser xpp, Condition owner, Condition.ConditionEvidenceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5564      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5565        res.getCode().add(parseCodeableConcept(xpp));
5566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
5567        res.getDetail().add(parseReference(xpp));
5568      } else if (!parseBackboneContent(eventType, xpp, res))
5569        return false;
5570    return true;
5571  }
5572
5573  protected Consent parseConsent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5574    Consent res = new Consent();
5575    parseDomainResourceAttributes(xpp, res);
5576    next(xpp);
5577    int eventType = nextNoWhitespace(xpp);
5578    while (eventType != XmlPullParser.END_TAG) {
5579  if (!parseConsentContent(eventType, xpp, res))
5580        unknownContent(xpp);
5581      eventType = nextNoWhitespace(xpp);
5582    }
5583    next(xpp);
5584    parseElementClose(res);
5585    return res;
5586  }
5587
5588  protected boolean parseConsentContent(int eventType, XmlPullParser xpp, Consent res) throws XmlPullParserException, IOException, FHIRFormatError {
5589      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5590        res.setIdentifier(parseIdentifier(xpp));
5591      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5592        res.setStatusElement(parseEnumeration(xpp, Consent.ConsentState.NULL, new Consent.ConsentStateEnumFactory()));
5593      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
5594        res.getCategory().add(parseCodeableConcept(xpp));
5595      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
5596        res.setPatient(parseReference(xpp));
5597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5598        res.setPeriod(parsePeriod(xpp));
5599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dateTime")) {
5600        res.setDateTimeElement(parseDateTime(xpp));
5601      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("consentingParty")) {
5602        res.getConsentingParty().add(parseReference(xpp));
5603      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5604        res.getActor().add(parseConsentConsentActorComponent(xpp, res));
5605      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5606        res.getAction().add(parseCodeableConcept(xpp));
5607      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
5608        res.getOrganization().add(parseReference(xpp));
5609      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "source")) {
5610        res.setSource(parseType("source", xpp));
5611      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policy")) {
5612        res.getPolicy().add(parseConsentConsentPolicyComponent(xpp, res));
5613      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyRule")) {
5614        res.setPolicyRuleElement(parseUri(xpp));
5615      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5616        res.getSecurityLabel().add(parseCoding(xpp));
5617      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5618        res.getPurpose().add(parseCoding(xpp));
5619      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5620        res.setDataPeriod(parsePeriod(xpp));
5621      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5622        res.getData().add(parseConsentConsentDataComponent(xpp, res));
5623      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("except")) {
5624        res.getExcept().add(parseConsentExceptComponent(xpp, res));
5625      } else if (!parseDomainResourceContent(eventType, xpp, res))
5626        return false;
5627    return true;
5628  }
5629
5630  protected Consent.ConsentActorComponent parseConsentConsentActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5631    Consent.ConsentActorComponent res = new Consent.ConsentActorComponent();
5632    parseBackboneAttributes(xpp, res);
5633    next(xpp);
5634    int eventType = nextNoWhitespace(xpp);
5635    while (eventType != XmlPullParser.END_TAG) {
5636  if (!parseConsentConsentActorComponentContent(eventType, xpp, owner, res))
5637        unknownContent(xpp);
5638      eventType = nextNoWhitespace(xpp);
5639    }
5640    next(xpp);
5641    parseElementClose(res);
5642    return res;
5643  }
5644
5645  protected boolean parseConsentConsentActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5646      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5647        res.setRole(parseCodeableConcept(xpp));
5648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5649        res.setReference(parseReference(xpp));
5650      } else if (!parseBackboneContent(eventType, xpp, res))
5651        return false;
5652    return true;
5653  }
5654
5655  protected Consent.ConsentPolicyComponent parseConsentConsentPolicyComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5656    Consent.ConsentPolicyComponent res = new Consent.ConsentPolicyComponent();
5657    parseBackboneAttributes(xpp, res);
5658    next(xpp);
5659    int eventType = nextNoWhitespace(xpp);
5660    while (eventType != XmlPullParser.END_TAG) {
5661  if (!parseConsentConsentPolicyComponentContent(eventType, xpp, owner, res))
5662        unknownContent(xpp);
5663      eventType = nextNoWhitespace(xpp);
5664    }
5665    next(xpp);
5666    parseElementClose(res);
5667    return res;
5668  }
5669
5670  protected boolean parseConsentConsentPolicyComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentPolicyComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5671      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5672        res.setAuthorityElement(parseUri(xpp));
5673      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
5674        res.setUriElement(parseUri(xpp));
5675      } else if (!parseBackboneContent(eventType, xpp, res))
5676        return false;
5677    return true;
5678  }
5679
5680  protected Consent.ConsentDataComponent parseConsentConsentDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5681    Consent.ConsentDataComponent res = new Consent.ConsentDataComponent();
5682    parseBackboneAttributes(xpp, res);
5683    next(xpp);
5684    int eventType = nextNoWhitespace(xpp);
5685    while (eventType != XmlPullParser.END_TAG) {
5686  if (!parseConsentConsentDataComponentContent(eventType, xpp, owner, res))
5687        unknownContent(xpp);
5688      eventType = nextNoWhitespace(xpp);
5689    }
5690    next(xpp);
5691    parseElementClose(res);
5692    return res;
5693  }
5694
5695  protected boolean parseConsentConsentDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ConsentDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5696      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5697        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5699        res.setReference(parseReference(xpp));
5700      } else if (!parseBackboneContent(eventType, xpp, res))
5701        return false;
5702    return true;
5703  }
5704
5705  protected Consent.ExceptComponent parseConsentExceptComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5706    Consent.ExceptComponent res = new Consent.ExceptComponent();
5707    parseBackboneAttributes(xpp, res);
5708    next(xpp);
5709    int eventType = nextNoWhitespace(xpp);
5710    while (eventType != XmlPullParser.END_TAG) {
5711  if (!parseConsentExceptComponentContent(eventType, xpp, owner, res))
5712        unknownContent(xpp);
5713      eventType = nextNoWhitespace(xpp);
5714    }
5715    next(xpp);
5716    parseElementClose(res);
5717    return res;
5718  }
5719
5720  protected boolean parseConsentExceptComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5721      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5722        res.setTypeElement(parseEnumeration(xpp, Consent.ConsentExceptType.NULL, new Consent.ConsentExceptTypeEnumFactory()));
5723      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
5724        res.setPeriod(parsePeriod(xpp));
5725      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5726        res.getActor().add(parseConsentExceptActorComponent(xpp, owner));
5727      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5728        res.getAction().add(parseCodeableConcept(xpp));
5729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5730        res.getSecurityLabel().add(parseCoding(xpp));
5731      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("purpose")) {
5732        res.getPurpose().add(parseCoding(xpp));
5733      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
5734        res.getClass_().add(parseCoding(xpp));
5735      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
5736        res.getCode().add(parseCoding(xpp));
5737      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dataPeriod")) {
5738        res.setDataPeriod(parsePeriod(xpp));
5739      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("data")) {
5740        res.getData().add(parseConsentExceptDataComponent(xpp, owner));
5741      } else if (!parseBackboneContent(eventType, xpp, res))
5742        return false;
5743    return true;
5744  }
5745
5746  protected Consent.ExceptActorComponent parseConsentExceptActorComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5747    Consent.ExceptActorComponent res = new Consent.ExceptActorComponent();
5748    parseBackboneAttributes(xpp, res);
5749    next(xpp);
5750    int eventType = nextNoWhitespace(xpp);
5751    while (eventType != XmlPullParser.END_TAG) {
5752  if (!parseConsentExceptActorComponentContent(eventType, xpp, owner, res))
5753        unknownContent(xpp);
5754      eventType = nextNoWhitespace(xpp);
5755    }
5756    next(xpp);
5757    parseElementClose(res);
5758    return res;
5759  }
5760
5761  protected boolean parseConsentExceptActorComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptActorComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5762      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5763        res.setRole(parseCodeableConcept(xpp));
5764      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5765        res.setReference(parseReference(xpp));
5766      } else if (!parseBackboneContent(eventType, xpp, res))
5767        return false;
5768    return true;
5769  }
5770
5771  protected Consent.ExceptDataComponent parseConsentExceptDataComponent(XmlPullParser xpp, Consent owner) throws XmlPullParserException, IOException, FHIRFormatError {
5772    Consent.ExceptDataComponent res = new Consent.ExceptDataComponent();
5773    parseBackboneAttributes(xpp, res);
5774    next(xpp);
5775    int eventType = nextNoWhitespace(xpp);
5776    while (eventType != XmlPullParser.END_TAG) {
5777  if (!parseConsentExceptDataComponentContent(eventType, xpp, owner, res))
5778        unknownContent(xpp);
5779      eventType = nextNoWhitespace(xpp);
5780    }
5781    next(xpp);
5782    parseElementClose(res);
5783    return res;
5784  }
5785
5786  protected boolean parseConsentExceptDataComponentContent(int eventType, XmlPullParser xpp, Consent owner, Consent.ExceptDataComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5787      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("meaning")) {
5788        res.setMeaningElement(parseEnumeration(xpp, Consent.ConsentDataMeaning.NULL, new Consent.ConsentDataMeaningEnumFactory()));
5789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
5790        res.setReference(parseReference(xpp));
5791      } else if (!parseBackboneContent(eventType, xpp, res))
5792        return false;
5793    return true;
5794  }
5795
5796  protected Contract parseContract(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
5797    Contract res = new Contract();
5798    parseDomainResourceAttributes(xpp, res);
5799    next(xpp);
5800    int eventType = nextNoWhitespace(xpp);
5801    while (eventType != XmlPullParser.END_TAG) {
5802  if (!parseContractContent(eventType, xpp, res))
5803        unknownContent(xpp);
5804      eventType = nextNoWhitespace(xpp);
5805    }
5806    next(xpp);
5807    parseElementClose(res);
5808    return res;
5809  }
5810
5811  protected boolean parseContractContent(int eventType, XmlPullParser xpp, Contract res) throws XmlPullParserException, IOException, FHIRFormatError {
5812      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5813        res.setIdentifier(parseIdentifier(xpp));
5814      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
5815        res.setStatusElement(parseEnumeration(xpp, Contract.ContractStatus.NULL, new Contract.ContractStatusEnumFactory()));
5816      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5817        res.setIssuedElement(parseDateTime(xpp));
5818      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5819        res.setApplies(parsePeriod(xpp));
5820      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
5821        res.getSubject().add(parseReference(xpp));
5822      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5823        res.getTopic().add(parseReference(xpp));
5824      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authority")) {
5825        res.getAuthority().add(parseReference(xpp));
5826      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("domain")) {
5827        res.getDomain().add(parseReference(xpp));
5828      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5829        res.setType(parseCodeableConcept(xpp));
5830      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5831        res.getSubType().add(parseCodeableConcept(xpp));
5832      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5833        res.getAction().add(parseCodeableConcept(xpp));
5834      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5835        res.getActionReason().add(parseCodeableConcept(xpp));
5836      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("decisionType")) {
5837        res.setDecisionType(parseCodeableConcept(xpp));
5838      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contentDerivative")) {
5839        res.setContentDerivative(parseCodeableConcept(xpp));
5840      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5841        res.getSecurityLabel().add(parseCoding(xpp));
5842      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5843        res.getAgent().add(parseContractAgentComponent(xpp, res));
5844      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signer")) {
5845        res.getSigner().add(parseContractSignatoryComponent(xpp, res));
5846      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5847        res.getValuedItem().add(parseContractValuedItemComponent(xpp, res));
5848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
5849        res.getTerm().add(parseContractTermComponent(xpp, res));
5850      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "binding")) {
5851        res.setBinding(parseType("binding", xpp));
5852      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("friendly")) {
5853        res.getFriendly().add(parseContractFriendlyLanguageComponent(xpp, res));
5854      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("legal")) {
5855        res.getLegal().add(parseContractLegalLanguageComponent(xpp, res));
5856      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rule")) {
5857        res.getRule().add(parseContractComputableLanguageComponent(xpp, res));
5858      } else if (!parseDomainResourceContent(eventType, xpp, res))
5859        return false;
5860    return true;
5861  }
5862
5863  protected Contract.AgentComponent parseContractAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5864    Contract.AgentComponent res = new Contract.AgentComponent();
5865    parseBackboneAttributes(xpp, res);
5866    next(xpp);
5867    int eventType = nextNoWhitespace(xpp);
5868    while (eventType != XmlPullParser.END_TAG) {
5869  if (!parseContractAgentComponentContent(eventType, xpp, owner, res))
5870        unknownContent(xpp);
5871      eventType = nextNoWhitespace(xpp);
5872    }
5873    next(xpp);
5874    parseElementClose(res);
5875    return res;
5876  }
5877
5878  protected boolean parseContractAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.AgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5879      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
5880        res.setActor(parseReference(xpp));
5881      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
5882        res.getRole().add(parseCodeableConcept(xpp));
5883      } else if (!parseBackboneContent(eventType, xpp, res))
5884        return false;
5885    return true;
5886  }
5887
5888  protected Contract.SignatoryComponent parseContractSignatoryComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5889    Contract.SignatoryComponent res = new Contract.SignatoryComponent();
5890    parseBackboneAttributes(xpp, res);
5891    next(xpp);
5892    int eventType = nextNoWhitespace(xpp);
5893    while (eventType != XmlPullParser.END_TAG) {
5894  if (!parseContractSignatoryComponentContent(eventType, xpp, owner, res))
5895        unknownContent(xpp);
5896      eventType = nextNoWhitespace(xpp);
5897    }
5898    next(xpp);
5899    parseElementClose(res);
5900    return res;
5901  }
5902
5903  protected boolean parseContractSignatoryComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.SignatoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5904      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5905        res.setType(parseCoding(xpp));
5906      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
5907        res.setParty(parseReference(xpp));
5908      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("signature")) {
5909        res.getSignature().add(parseSignature(xpp));
5910      } else if (!parseBackboneContent(eventType, xpp, res))
5911        return false;
5912    return true;
5913  }
5914
5915  protected Contract.ValuedItemComponent parseContractValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5916    Contract.ValuedItemComponent res = new Contract.ValuedItemComponent();
5917    parseBackboneAttributes(xpp, res);
5918    next(xpp);
5919    int eventType = nextNoWhitespace(xpp);
5920    while (eventType != XmlPullParser.END_TAG) {
5921  if (!parseContractValuedItemComponentContent(eventType, xpp, owner, res))
5922        unknownContent(xpp);
5923      eventType = nextNoWhitespace(xpp);
5924    }
5925    next(xpp);
5926    parseElementClose(res);
5927    return res;
5928  }
5929
5930  protected boolean parseContractValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5931      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
5932        res.setEntity(parseType("entity", xpp));
5933      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5934        res.setIdentifier(parseIdentifier(xpp));
5935      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
5936        res.setEffectiveTimeElement(parseDateTime(xpp));
5937      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
5938        res.setQuantity(parseSimpleQuantity(xpp));
5939      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
5940        res.setUnitPrice(parseMoney(xpp));
5941      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
5942        res.setFactorElement(parseDecimal(xpp));
5943      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
5944        res.setPointsElement(parseDecimal(xpp));
5945      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
5946        res.setNet(parseMoney(xpp));
5947      } else if (!parseBackboneContent(eventType, xpp, res))
5948        return false;
5949    return true;
5950  }
5951
5952  protected Contract.TermComponent parseContractTermComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
5953    Contract.TermComponent res = new Contract.TermComponent();
5954    parseBackboneAttributes(xpp, res);
5955    next(xpp);
5956    int eventType = nextNoWhitespace(xpp);
5957    while (eventType != XmlPullParser.END_TAG) {
5958  if (!parseContractTermComponentContent(eventType, xpp, owner, res))
5959        unknownContent(xpp);
5960      eventType = nextNoWhitespace(xpp);
5961    }
5962    next(xpp);
5963    parseElementClose(res);
5964    return res;
5965  }
5966
5967  protected boolean parseContractTermComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
5968      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
5969        res.setIdentifier(parseIdentifier(xpp));
5970      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
5971        res.setIssuedElement(parseDateTime(xpp));
5972      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("applies")) {
5973        res.setApplies(parsePeriod(xpp));
5974      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
5975        res.setType(parseCodeableConcept(xpp));
5976      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
5977        res.setSubType(parseCodeableConcept(xpp));
5978      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("topic")) {
5979        res.getTopic().add(parseReference(xpp));
5980      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
5981        res.getAction().add(parseCodeableConcept(xpp));
5982      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actionReason")) {
5983        res.getActionReason().add(parseCodeableConcept(xpp));
5984      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
5985        res.getSecurityLabel().add(parseCoding(xpp));
5986      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
5987        res.getAgent().add(parseContractTermAgentComponent(xpp, owner));
5988      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("text")) {
5989        res.setTextElement(parseString(xpp));
5990      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("valuedItem")) {
5991        res.getValuedItem().add(parseContractTermValuedItemComponent(xpp, owner));
5992      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
5993        res.getGroup().add(parseContractTermComponent(xpp, owner));
5994      } else if (!parseBackboneContent(eventType, xpp, res))
5995        return false;
5996    return true;
5997  }
5998
5999  protected Contract.TermAgentComponent parseContractTermAgentComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6000    Contract.TermAgentComponent res = new Contract.TermAgentComponent();
6001    parseBackboneAttributes(xpp, res);
6002    next(xpp);
6003    int eventType = nextNoWhitespace(xpp);
6004    while (eventType != XmlPullParser.END_TAG) {
6005  if (!parseContractTermAgentComponentContent(eventType, xpp, owner, res))
6006        unknownContent(xpp);
6007      eventType = nextNoWhitespace(xpp);
6008    }
6009    next(xpp);
6010    parseElementClose(res);
6011    return res;
6012  }
6013
6014  protected boolean parseContractTermAgentComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermAgentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6015      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6016        res.setActor(parseReference(xpp));
6017      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6018        res.getRole().add(parseCodeableConcept(xpp));
6019      } else if (!parseBackboneContent(eventType, xpp, res))
6020        return false;
6021    return true;
6022  }
6023
6024  protected Contract.TermValuedItemComponent parseContractTermValuedItemComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6025    Contract.TermValuedItemComponent res = new Contract.TermValuedItemComponent();
6026    parseBackboneAttributes(xpp, res);
6027    next(xpp);
6028    int eventType = nextNoWhitespace(xpp);
6029    while (eventType != XmlPullParser.END_TAG) {
6030  if (!parseContractTermValuedItemComponentContent(eventType, xpp, owner, res))
6031        unknownContent(xpp);
6032      eventType = nextNoWhitespace(xpp);
6033    }
6034    next(xpp);
6035    parseElementClose(res);
6036    return res;
6037  }
6038
6039  protected boolean parseContractTermValuedItemComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.TermValuedItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6040      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "entity")) {
6041        res.setEntity(parseType("entity", xpp));
6042      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6043        res.setIdentifier(parseIdentifier(xpp));
6044      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("effectiveTime")) {
6045        res.setEffectiveTimeElement(parseDateTime(xpp));
6046      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("quantity")) {
6047        res.setQuantity(parseSimpleQuantity(xpp));
6048      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unitPrice")) {
6049        res.setUnitPrice(parseMoney(xpp));
6050      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("factor")) {
6051        res.setFactorElement(parseDecimal(xpp));
6052      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("points")) {
6053        res.setPointsElement(parseDecimal(xpp));
6054      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("net")) {
6055        res.setNet(parseMoney(xpp));
6056      } else if (!parseBackboneContent(eventType, xpp, res))
6057        return false;
6058    return true;
6059  }
6060
6061  protected Contract.FriendlyLanguageComponent parseContractFriendlyLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6062    Contract.FriendlyLanguageComponent res = new Contract.FriendlyLanguageComponent();
6063    parseBackboneAttributes(xpp, res);
6064    next(xpp);
6065    int eventType = nextNoWhitespace(xpp);
6066    while (eventType != XmlPullParser.END_TAG) {
6067  if (!parseContractFriendlyLanguageComponentContent(eventType, xpp, owner, res))
6068        unknownContent(xpp);
6069      eventType = nextNoWhitespace(xpp);
6070    }
6071    next(xpp);
6072    parseElementClose(res);
6073    return res;
6074  }
6075
6076  protected boolean parseContractFriendlyLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.FriendlyLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6077      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6078        res.setContent(parseType("content", xpp));
6079      } else if (!parseBackboneContent(eventType, xpp, res))
6080        return false;
6081    return true;
6082  }
6083
6084  protected Contract.LegalLanguageComponent parseContractLegalLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6085    Contract.LegalLanguageComponent res = new Contract.LegalLanguageComponent();
6086    parseBackboneAttributes(xpp, res);
6087    next(xpp);
6088    int eventType = nextNoWhitespace(xpp);
6089    while (eventType != XmlPullParser.END_TAG) {
6090  if (!parseContractLegalLanguageComponentContent(eventType, xpp, owner, res))
6091        unknownContent(xpp);
6092      eventType = nextNoWhitespace(xpp);
6093    }
6094    next(xpp);
6095    parseElementClose(res);
6096    return res;
6097  }
6098
6099  protected boolean parseContractLegalLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.LegalLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6100      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6101        res.setContent(parseType("content", xpp));
6102      } else if (!parseBackboneContent(eventType, xpp, res))
6103        return false;
6104    return true;
6105  }
6106
6107  protected Contract.ComputableLanguageComponent parseContractComputableLanguageComponent(XmlPullParser xpp, Contract owner) throws XmlPullParserException, IOException, FHIRFormatError {
6108    Contract.ComputableLanguageComponent res = new Contract.ComputableLanguageComponent();
6109    parseBackboneAttributes(xpp, res);
6110    next(xpp);
6111    int eventType = nextNoWhitespace(xpp);
6112    while (eventType != XmlPullParser.END_TAG) {
6113  if (!parseContractComputableLanguageComponentContent(eventType, xpp, owner, res))
6114        unknownContent(xpp);
6115      eventType = nextNoWhitespace(xpp);
6116    }
6117    next(xpp);
6118    parseElementClose(res);
6119    return res;
6120  }
6121
6122  protected boolean parseContractComputableLanguageComponentContent(int eventType, XmlPullParser xpp, Contract owner, Contract.ComputableLanguageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6123      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "content")) {
6124        res.setContent(parseType("content", xpp));
6125      } else if (!parseBackboneContent(eventType, xpp, res))
6126        return false;
6127    return true;
6128  }
6129
6130  protected Coverage parseCoverage(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6131    Coverage res = new Coverage();
6132    parseDomainResourceAttributes(xpp, res);
6133    next(xpp);
6134    int eventType = nextNoWhitespace(xpp);
6135    while (eventType != XmlPullParser.END_TAG) {
6136  if (!parseCoverageContent(eventType, xpp, res))
6137        unknownContent(xpp);
6138      eventType = nextNoWhitespace(xpp);
6139    }
6140    next(xpp);
6141    parseElementClose(res);
6142    return res;
6143  }
6144
6145  protected boolean parseCoverageContent(int eventType, XmlPullParser xpp, Coverage res) throws XmlPullParserException, IOException, FHIRFormatError {
6146      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6147        res.getIdentifier().add(parseIdentifier(xpp));
6148      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6149        res.setStatusElement(parseEnumeration(xpp, Coverage.CoverageStatus.NULL, new Coverage.CoverageStatusEnumFactory()));
6150      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6151        res.setType(parseCodeableConcept(xpp));
6152      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("policyHolder")) {
6153        res.setPolicyHolder(parseReference(xpp));
6154      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriber")) {
6155        res.setSubscriber(parseReference(xpp));
6156      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subscriberId")) {
6157        res.setSubscriberIdElement(parseString(xpp));
6158      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("beneficiary")) {
6159        res.setBeneficiary(parseReference(xpp));
6160      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
6161        res.setRelationship(parseCodeableConcept(xpp));
6162      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
6163        res.setPeriod(parsePeriod(xpp));
6164      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payor")) {
6165        res.getPayor().add(parseReference(xpp));
6166      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("grouping")) {
6167        res.setGrouping(parseCoverageGroupComponent(xpp, res));
6168      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dependent")) {
6169        res.setDependentElement(parseString(xpp));
6170      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
6171        res.setSequenceElement(parseString(xpp));
6172      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("order")) {
6173        res.setOrderElement(parsePositiveInt(xpp));
6174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
6175        res.setNetworkElement(parseString(xpp));
6176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
6177        res.getContract().add(parseReference(xpp));
6178      } else if (!parseDomainResourceContent(eventType, xpp, res))
6179        return false;
6180    return true;
6181  }
6182
6183  protected Coverage.GroupComponent parseCoverageGroupComponent(XmlPullParser xpp, Coverage owner) throws XmlPullParserException, IOException, FHIRFormatError {
6184    Coverage.GroupComponent res = new Coverage.GroupComponent();
6185    parseBackboneAttributes(xpp, res);
6186    next(xpp);
6187    int eventType = nextNoWhitespace(xpp);
6188    while (eventType != XmlPullParser.END_TAG) {
6189  if (!parseCoverageGroupComponentContent(eventType, xpp, owner, res))
6190        unknownContent(xpp);
6191      eventType = nextNoWhitespace(xpp);
6192    }
6193    next(xpp);
6194    parseElementClose(res);
6195    return res;
6196  }
6197
6198  protected boolean parseCoverageGroupComponentContent(int eventType, XmlPullParser xpp, Coverage owner, Coverage.GroupComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6199      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("group")) {
6200        res.setGroupElement(parseString(xpp));
6201      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupDisplay")) {
6202        res.setGroupDisplayElement(parseString(xpp));
6203      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroup")) {
6204        res.setSubGroupElement(parseString(xpp));
6205      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subGroupDisplay")) {
6206        res.setSubGroupDisplayElement(parseString(xpp));
6207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("plan")) {
6208        res.setPlanElement(parseString(xpp));
6209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("planDisplay")) {
6210        res.setPlanDisplayElement(parseString(xpp));
6211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlan")) {
6212        res.setSubPlanElement(parseString(xpp));
6213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subPlanDisplay")) {
6214        res.setSubPlanDisplayElement(parseString(xpp));
6215      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6216        res.setClass_Element(parseString(xpp));
6217      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classDisplay")) {
6218        res.setClassDisplayElement(parseString(xpp));
6219      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClass")) {
6220        res.setSubClassElement(parseString(xpp));
6221      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subClassDisplay")) {
6222        res.setSubClassDisplayElement(parseString(xpp));
6223      } else if (!parseBackboneContent(eventType, xpp, res))
6224        return false;
6225    return true;
6226  }
6227
6228  protected DataElement parseDataElement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6229    DataElement res = new DataElement();
6230    parseDomainResourceAttributes(xpp, res);
6231    next(xpp);
6232    int eventType = nextNoWhitespace(xpp);
6233    while (eventType != XmlPullParser.END_TAG) {
6234  if (!parseDataElementContent(eventType, xpp, res))
6235        unknownContent(xpp);
6236      eventType = nextNoWhitespace(xpp);
6237    }
6238    next(xpp);
6239    parseElementClose(res);
6240    return res;
6241  }
6242
6243  protected boolean parseDataElementContent(int eventType, XmlPullParser xpp, DataElement res) throws XmlPullParserException, IOException, FHIRFormatError {
6244      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6245        res.setUrlElement(parseUri(xpp));
6246      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6247        res.getIdentifier().add(parseIdentifier(xpp));
6248      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6249        res.setVersionElement(parseString(xpp));
6250      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6251        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
6252      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
6253        res.setExperimentalElement(parseBoolean(xpp));
6254      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6255        res.setDateElement(parseDateTime(xpp));
6256      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
6257        res.setPublisherElement(parseString(xpp));
6258      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6259        res.setNameElement(parseString(xpp));
6260      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("title")) {
6261        res.setTitleElement(parseString(xpp));
6262      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6263        res.getContact().add(parseContactDetail(xpp));
6264      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
6265        res.getUseContext().add(parseUsageContext(xpp));
6266      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6267        res.getJurisdiction().add(parseCodeableConcept(xpp));
6268      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("copyright")) {
6269        res.setCopyrightElement(parseMarkdown(xpp));
6270      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("stringency")) {
6271        res.setStringencyElement(parseEnumeration(xpp, DataElement.DataElementStringency.NULL, new DataElement.DataElementStringencyEnumFactory()));
6272      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mapping")) {
6273        res.getMapping().add(parseDataElementDataElementMappingComponent(xpp, res));
6274      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("element")) {
6275        res.getElement().add(parseElementDefinition(xpp));
6276      } else if (!parseDomainResourceContent(eventType, xpp, res))
6277        return false;
6278    return true;
6279  }
6280
6281  protected DataElement.DataElementMappingComponent parseDataElementDataElementMappingComponent(XmlPullParser xpp, DataElement owner) throws XmlPullParserException, IOException, FHIRFormatError {
6282    DataElement.DataElementMappingComponent res = new DataElement.DataElementMappingComponent();
6283    parseBackboneAttributes(xpp, res);
6284    next(xpp);
6285    int eventType = nextNoWhitespace(xpp);
6286    while (eventType != XmlPullParser.END_TAG) {
6287  if (!parseDataElementDataElementMappingComponentContent(eventType, xpp, owner, res))
6288        unknownContent(xpp);
6289      eventType = nextNoWhitespace(xpp);
6290    }
6291    next(xpp);
6292    parseElementClose(res);
6293    return res;
6294  }
6295
6296  protected boolean parseDataElementDataElementMappingComponentContent(int eventType, XmlPullParser xpp, DataElement owner, DataElement.DataElementMappingComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6297      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identity")) {
6298        res.setIdentityElement(parseId(xpp));
6299      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("uri")) {
6300        res.setUriElement(parseUri(xpp));
6301      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6302        res.setNameElement(parseString(xpp));
6303      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6304        res.setCommentElement(parseString(xpp));
6305      } else if (!parseBackboneContent(eventType, xpp, res))
6306        return false;
6307    return true;
6308  }
6309
6310  protected DetectedIssue parseDetectedIssue(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6311    DetectedIssue res = new DetectedIssue();
6312    parseDomainResourceAttributes(xpp, res);
6313    next(xpp);
6314    int eventType = nextNoWhitespace(xpp);
6315    while (eventType != XmlPullParser.END_TAG) {
6316  if (!parseDetectedIssueContent(eventType, xpp, res))
6317        unknownContent(xpp);
6318      eventType = nextNoWhitespace(xpp);
6319    }
6320    next(xpp);
6321    parseElementClose(res);
6322    return res;
6323  }
6324
6325  protected boolean parseDetectedIssueContent(int eventType, XmlPullParser xpp, DetectedIssue res) throws XmlPullParserException, IOException, FHIRFormatError {
6326      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6327        res.setIdentifier(parseIdentifier(xpp));
6328      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6329        res.setStatusElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueStatus.NULL, new DetectedIssue.DetectedIssueStatusEnumFactory()));
6330      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6331        res.setCategory(parseCodeableConcept(xpp));
6332      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("severity")) {
6333        res.setSeverityElement(parseEnumeration(xpp, DetectedIssue.DetectedIssueSeverity.NULL, new DetectedIssue.DetectedIssueSeverityEnumFactory()));
6334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6335        res.setPatient(parseReference(xpp));
6336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6337        res.setDateElement(parseDateTime(xpp));
6338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6339        res.setAuthor(parseReference(xpp));
6340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("implicated")) {
6341        res.getImplicated().add(parseReference(xpp));
6342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("detail")) {
6343        res.setDetailElement(parseString(xpp));
6344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
6345        res.setReferenceElement(parseUri(xpp));
6346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mitigation")) {
6347        res.getMitigation().add(parseDetectedIssueDetectedIssueMitigationComponent(xpp, res));
6348      } else if (!parseDomainResourceContent(eventType, xpp, res))
6349        return false;
6350    return true;
6351  }
6352
6353  protected DetectedIssue.DetectedIssueMitigationComponent parseDetectedIssueDetectedIssueMitigationComponent(XmlPullParser xpp, DetectedIssue owner) throws XmlPullParserException, IOException, FHIRFormatError {
6354    DetectedIssue.DetectedIssueMitigationComponent res = new DetectedIssue.DetectedIssueMitigationComponent();
6355    parseBackboneAttributes(xpp, res);
6356    next(xpp);
6357    int eventType = nextNoWhitespace(xpp);
6358    while (eventType != XmlPullParser.END_TAG) {
6359  if (!parseDetectedIssueDetectedIssueMitigationComponentContent(eventType, xpp, owner, res))
6360        unknownContent(xpp);
6361      eventType = nextNoWhitespace(xpp);
6362    }
6363    next(xpp);
6364    parseElementClose(res);
6365    return res;
6366  }
6367
6368  protected boolean parseDetectedIssueDetectedIssueMitigationComponentContent(int eventType, XmlPullParser xpp, DetectedIssue owner, DetectedIssue.DetectedIssueMitigationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6369      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("action")) {
6370        res.setAction(parseCodeableConcept(xpp));
6371      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
6372        res.setDateElement(parseDateTime(xpp));
6373      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6374        res.setAuthor(parseReference(xpp));
6375      } else if (!parseBackboneContent(eventType, xpp, res))
6376        return false;
6377    return true;
6378  }
6379
6380  protected Device parseDevice(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6381    Device res = new Device();
6382    parseDomainResourceAttributes(xpp, res);
6383    next(xpp);
6384    int eventType = nextNoWhitespace(xpp);
6385    while (eventType != XmlPullParser.END_TAG) {
6386  if (!parseDeviceContent(eventType, xpp, res))
6387        unknownContent(xpp);
6388      eventType = nextNoWhitespace(xpp);
6389    }
6390    next(xpp);
6391    parseElementClose(res);
6392    return res;
6393  }
6394
6395  protected boolean parseDeviceContent(int eventType, XmlPullParser xpp, Device res) throws XmlPullParserException, IOException, FHIRFormatError {
6396      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6397        res.getIdentifier().add(parseIdentifier(xpp));
6398      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("udi")) {
6399        res.setUdi(parseDeviceDeviceUdiComponent(xpp, res));
6400      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6401        res.setStatusElement(parseEnumeration(xpp, Device.FHIRDeviceStatus.NULL, new Device.FHIRDeviceStatusEnumFactory()));
6402      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6403        res.setType(parseCodeableConcept(xpp));
6404      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lotNumber")) {
6405        res.setLotNumberElement(parseString(xpp));
6406      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufacturer")) {
6407        res.setManufacturerElement(parseString(xpp));
6408      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("manufactureDate")) {
6409        res.setManufactureDateElement(parseDateTime(xpp));
6410      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("expirationDate")) {
6411        res.setExpirationDateElement(parseDateTime(xpp));
6412      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("model")) {
6413        res.setModelElement(parseString(xpp));
6414      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
6415        res.setVersionElement(parseString(xpp));
6416      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
6417        res.setPatient(parseReference(xpp));
6418      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("owner")) {
6419        res.setOwner(parseReference(xpp));
6420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
6421        res.getContact().add(parseContactPoint(xpp));
6422      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
6423        res.setLocation(parseReference(xpp));
6424      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
6425        res.setUrlElement(parseUri(xpp));
6426      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6427        res.getNote().add(parseAnnotation(xpp));
6428      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("safety")) {
6429        res.getSafety().add(parseCodeableConcept(xpp));
6430      } else if (!parseDomainResourceContent(eventType, xpp, res))
6431        return false;
6432    return true;
6433  }
6434
6435  protected Device.DeviceUdiComponent parseDeviceDeviceUdiComponent(XmlPullParser xpp, Device owner) throws XmlPullParserException, IOException, FHIRFormatError {
6436    Device.DeviceUdiComponent res = new Device.DeviceUdiComponent();
6437    parseBackboneAttributes(xpp, res);
6438    next(xpp);
6439    int eventType = nextNoWhitespace(xpp);
6440    while (eventType != XmlPullParser.END_TAG) {
6441  if (!parseDeviceDeviceUdiComponentContent(eventType, xpp, owner, res))
6442        unknownContent(xpp);
6443      eventType = nextNoWhitespace(xpp);
6444    }
6445    next(xpp);
6446    parseElementClose(res);
6447    return res;
6448  }
6449
6450  protected boolean parseDeviceDeviceUdiComponentContent(int eventType, XmlPullParser xpp, Device owner, Device.DeviceUdiComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6451      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("deviceIdentifier")) {
6452        res.setDeviceIdentifierElement(parseString(xpp));
6453      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
6454        res.setNameElement(parseString(xpp));
6455      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
6456        res.setJurisdictionElement(parseUri(xpp));
6457      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierHRF")) {
6458        res.setCarrierHRFElement(parseString(xpp));
6459      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("carrierAIDC")) {
6460        res.setCarrierAIDCElement(parseBase64Binary(xpp));
6461      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issuer")) {
6462        res.setIssuerElement(parseUri(xpp));
6463      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("entryType")) {
6464        res.setEntryTypeElement(parseEnumeration(xpp, Device.UDIEntryType.NULL, new Device.UDIEntryTypeEnumFactory()));
6465      } else if (!parseBackboneContent(eventType, xpp, res))
6466        return false;
6467    return true;
6468  }
6469
6470  protected DeviceComponent parseDeviceComponent(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6471    DeviceComponent res = new DeviceComponent();
6472    parseDomainResourceAttributes(xpp, res);
6473    next(xpp);
6474    int eventType = nextNoWhitespace(xpp);
6475    while (eventType != XmlPullParser.END_TAG) {
6476  if (!parseDeviceComponentContent(eventType, xpp, res))
6477        unknownContent(xpp);
6478      eventType = nextNoWhitespace(xpp);
6479    }
6480    next(xpp);
6481    parseElementClose(res);
6482    return res;
6483  }
6484
6485  protected boolean parseDeviceComponentContent(int eventType, XmlPullParser xpp, DeviceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6486      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6487        res.setIdentifier(parseIdentifier(xpp));
6488      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6489        res.setType(parseCodeableConcept(xpp));
6490      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("lastSystemChange")) {
6491        res.setLastSystemChangeElement(parseInstant(xpp));
6492      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6493        res.setSource(parseReference(xpp));
6494      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6495        res.setParent(parseReference(xpp));
6496      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6497        res.getOperationalStatus().add(parseCodeableConcept(xpp));
6498      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parameterGroup")) {
6499        res.setParameterGroup(parseCodeableConcept(xpp));
6500      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPrinciple")) {
6501        res.setMeasurementPrincipleElement(parseEnumeration(xpp, DeviceComponent.MeasmntPrinciple.NULL, new DeviceComponent.MeasmntPrincipleEnumFactory()));
6502      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpecification")) {
6503        res.getProductionSpecification().add(parseDeviceComponentDeviceComponentProductionSpecificationComponent(xpp, res));
6504      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("languageCode")) {
6505        res.setLanguageCode(parseCodeableConcept(xpp));
6506      } else if (!parseDomainResourceContent(eventType, xpp, res))
6507        return false;
6508    return true;
6509  }
6510
6511  protected DeviceComponent.DeviceComponentProductionSpecificationComponent parseDeviceComponentDeviceComponentProductionSpecificationComponent(XmlPullParser xpp, DeviceComponent owner) throws XmlPullParserException, IOException, FHIRFormatError {
6512    DeviceComponent.DeviceComponentProductionSpecificationComponent res = new DeviceComponent.DeviceComponentProductionSpecificationComponent();
6513    parseBackboneAttributes(xpp, res);
6514    next(xpp);
6515    int eventType = nextNoWhitespace(xpp);
6516    while (eventType != XmlPullParser.END_TAG) {
6517  if (!parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(eventType, xpp, owner, res))
6518        unknownContent(xpp);
6519      eventType = nextNoWhitespace(xpp);
6520    }
6521    next(xpp);
6522    parseElementClose(res);
6523    return res;
6524  }
6525
6526  protected boolean parseDeviceComponentDeviceComponentProductionSpecificationComponentContent(int eventType, XmlPullParser xpp, DeviceComponent owner, DeviceComponent.DeviceComponentProductionSpecificationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6527      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specType")) {
6528        res.setSpecType(parseCodeableConcept(xpp));
6529      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("componentId")) {
6530        res.setComponentId(parseIdentifier(xpp));
6531      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("productionSpec")) {
6532        res.setProductionSpecElement(parseString(xpp));
6533      } else if (!parseBackboneContent(eventType, xpp, res))
6534        return false;
6535    return true;
6536  }
6537
6538  protected DeviceMetric parseDeviceMetric(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6539    DeviceMetric res = new DeviceMetric();
6540    parseDomainResourceAttributes(xpp, res);
6541    next(xpp);
6542    int eventType = nextNoWhitespace(xpp);
6543    while (eventType != XmlPullParser.END_TAG) {
6544  if (!parseDeviceMetricContent(eventType, xpp, res))
6545        unknownContent(xpp);
6546      eventType = nextNoWhitespace(xpp);
6547    }
6548    next(xpp);
6549    parseElementClose(res);
6550    return res;
6551  }
6552
6553  protected boolean parseDeviceMetricContent(int eventType, XmlPullParser xpp, DeviceMetric res) throws XmlPullParserException, IOException, FHIRFormatError {
6554      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6555        res.setIdentifier(parseIdentifier(xpp));
6556      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6557        res.setType(parseCodeableConcept(xpp));
6558      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
6559        res.setUnit(parseCodeableConcept(xpp));
6560      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6561        res.setSource(parseReference(xpp));
6562      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("parent")) {
6563        res.setParent(parseReference(xpp));
6564      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("operationalStatus")) {
6565        res.setOperationalStatusElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricOperationalStatus.NULL, new DeviceMetric.DeviceMetricOperationalStatusEnumFactory()));
6566      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("color")) {
6567        res.setColorElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricColor.NULL, new DeviceMetric.DeviceMetricColorEnumFactory()));
6568      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6569        res.setCategoryElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCategory.NULL, new DeviceMetric.DeviceMetricCategoryEnumFactory()));
6570      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("measurementPeriod")) {
6571        res.setMeasurementPeriod(parseTiming(xpp));
6572      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("calibration")) {
6573        res.getCalibration().add(parseDeviceMetricDeviceMetricCalibrationComponent(xpp, res));
6574      } else if (!parseDomainResourceContent(eventType, xpp, res))
6575        return false;
6576    return true;
6577  }
6578
6579  protected DeviceMetric.DeviceMetricCalibrationComponent parseDeviceMetricDeviceMetricCalibrationComponent(XmlPullParser xpp, DeviceMetric owner) throws XmlPullParserException, IOException, FHIRFormatError {
6580    DeviceMetric.DeviceMetricCalibrationComponent res = new DeviceMetric.DeviceMetricCalibrationComponent();
6581    parseBackboneAttributes(xpp, res);
6582    next(xpp);
6583    int eventType = nextNoWhitespace(xpp);
6584    while (eventType != XmlPullParser.END_TAG) {
6585  if (!parseDeviceMetricDeviceMetricCalibrationComponentContent(eventType, xpp, owner, res))
6586        unknownContent(xpp);
6587      eventType = nextNoWhitespace(xpp);
6588    }
6589    next(xpp);
6590    parseElementClose(res);
6591    return res;
6592  }
6593
6594  protected boolean parseDeviceMetricDeviceMetricCalibrationComponentContent(int eventType, XmlPullParser xpp, DeviceMetric owner, DeviceMetric.DeviceMetricCalibrationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6595      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6596        res.setTypeElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationType.NULL, new DeviceMetric.DeviceMetricCalibrationTypeEnumFactory()));
6597      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("state")) {
6598        res.setStateElement(parseEnumeration(xpp, DeviceMetric.DeviceMetricCalibrationState.NULL, new DeviceMetric.DeviceMetricCalibrationStateEnumFactory()));
6599      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("time")) {
6600        res.setTimeElement(parseInstant(xpp));
6601      } else if (!parseBackboneContent(eventType, xpp, res))
6602        return false;
6603    return true;
6604  }
6605
6606  protected DeviceRequest parseDeviceRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6607    DeviceRequest res = new DeviceRequest();
6608    parseDomainResourceAttributes(xpp, res);
6609    next(xpp);
6610    int eventType = nextNoWhitespace(xpp);
6611    while (eventType != XmlPullParser.END_TAG) {
6612  if (!parseDeviceRequestContent(eventType, xpp, res))
6613        unknownContent(xpp);
6614      eventType = nextNoWhitespace(xpp);
6615    }
6616    next(xpp);
6617    parseElementClose(res);
6618    return res;
6619  }
6620
6621  protected boolean parseDeviceRequestContent(int eventType, XmlPullParser xpp, DeviceRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
6622      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6623        res.getIdentifier().add(parseIdentifier(xpp));
6624      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("definition")) {
6625        res.getDefinition().add(parseReference(xpp));
6626      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6627        res.getBasedOn().add(parseReference(xpp));
6628      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priorRequest")) {
6629        res.getPriorRequest().add(parseReference(xpp));
6630      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("groupIdentifier")) {
6631        res.setGroupIdentifier(parseIdentifier(xpp));
6632      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6633        res.setStatusElement(parseEnumeration(xpp, DeviceRequest.DeviceRequestStatus.NULL, new DeviceRequest.DeviceRequestStatusEnumFactory()));
6634      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("intent")) {
6635        res.setIntent(parseCodeableConcept(xpp));
6636      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
6637        res.setPriorityElement(parseEnumeration(xpp, DeviceRequest.RequestPriority.NULL, new DeviceRequest.RequestPriorityEnumFactory()));
6638      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "code")) {
6639        res.setCode(parseType("code", xpp));
6640      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6641        res.setSubject(parseReference(xpp));
6642      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6643        res.setContext(parseReference(xpp));
6644      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "occurrence")) {
6645        res.setOccurrence(parseType("occurrence", xpp));
6646      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authoredOn")) {
6647        res.setAuthoredOnElement(parseDateTime(xpp));
6648      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requester")) {
6649        res.setRequester(parseDeviceRequestDeviceRequestRequesterComponent(xpp, res));
6650      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performerType")) {
6651        res.setPerformerType(parseCodeableConcept(xpp));
6652      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6653        res.setPerformer(parseReference(xpp));
6654      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonCode")) {
6655        res.getReasonCode().add(parseCodeableConcept(xpp));
6656      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reasonReference")) {
6657        res.getReasonReference().add(parseReference(xpp));
6658      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("supportingInfo")) {
6659        res.getSupportingInfo().add(parseReference(xpp));
6660      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6661        res.getNote().add(parseAnnotation(xpp));
6662      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relevantHistory")) {
6663        res.getRelevantHistory().add(parseReference(xpp));
6664      } else if (!parseDomainResourceContent(eventType, xpp, res))
6665        return false;
6666    return true;
6667  }
6668
6669  protected DeviceRequest.DeviceRequestRequesterComponent parseDeviceRequestDeviceRequestRequesterComponent(XmlPullParser xpp, DeviceRequest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6670    DeviceRequest.DeviceRequestRequesterComponent res = new DeviceRequest.DeviceRequestRequesterComponent();
6671    parseBackboneAttributes(xpp, res);
6672    next(xpp);
6673    int eventType = nextNoWhitespace(xpp);
6674    while (eventType != XmlPullParser.END_TAG) {
6675  if (!parseDeviceRequestDeviceRequestRequesterComponentContent(eventType, xpp, owner, res))
6676        unknownContent(xpp);
6677      eventType = nextNoWhitespace(xpp);
6678    }
6679    next(xpp);
6680    parseElementClose(res);
6681    return res;
6682  }
6683
6684  protected boolean parseDeviceRequestDeviceRequestRequesterComponentContent(int eventType, XmlPullParser xpp, DeviceRequest owner, DeviceRequest.DeviceRequestRequesterComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6685      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("agent")) {
6686        res.setAgent(parseReference(xpp));
6687      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("onBehalfOf")) {
6688        res.setOnBehalfOf(parseReference(xpp));
6689      } else if (!parseBackboneContent(eventType, xpp, res))
6690        return false;
6691    return true;
6692  }
6693
6694  protected DeviceUseStatement parseDeviceUseStatement(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6695    DeviceUseStatement res = new DeviceUseStatement();
6696    parseDomainResourceAttributes(xpp, res);
6697    next(xpp);
6698    int eventType = nextNoWhitespace(xpp);
6699    while (eventType != XmlPullParser.END_TAG) {
6700  if (!parseDeviceUseStatementContent(eventType, xpp, res))
6701        unknownContent(xpp);
6702      eventType = nextNoWhitespace(xpp);
6703    }
6704    next(xpp);
6705    parseElementClose(res);
6706    return res;
6707  }
6708
6709  protected boolean parseDeviceUseStatementContent(int eventType, XmlPullParser xpp, DeviceUseStatement res) throws XmlPullParserException, IOException, FHIRFormatError {
6710      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6711        res.getIdentifier().add(parseIdentifier(xpp));
6712      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6713        res.setStatusElement(parseEnumeration(xpp, DeviceUseStatement.DeviceUseStatementStatus.NULL, new DeviceUseStatement.DeviceUseStatementStatusEnumFactory()));
6714      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6715        res.setSubject(parseReference(xpp));
6716      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("whenUsed")) {
6717        res.setWhenUsed(parsePeriod(xpp));
6718      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
6719        res.setTiming(parseType("timing", xpp));
6720      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recordedOn")) {
6721        res.setRecordedOnElement(parseDateTime(xpp));
6722      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6723        res.setSource(parseReference(xpp));
6724      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("device")) {
6725        res.setDevice(parseReference(xpp));
6726      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indication")) {
6727        res.getIndication().add(parseCodeableConcept(xpp));
6728      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("bodySite")) {
6729        res.setBodySite(parseCodeableConcept(xpp));
6730      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("note")) {
6731        res.getNote().add(parseAnnotation(xpp));
6732      } else if (!parseDomainResourceContent(eventType, xpp, res))
6733        return false;
6734    return true;
6735  }
6736
6737  protected DiagnosticReport parseDiagnosticReport(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6738    DiagnosticReport res = new DiagnosticReport();
6739    parseDomainResourceAttributes(xpp, res);
6740    next(xpp);
6741    int eventType = nextNoWhitespace(xpp);
6742    while (eventType != XmlPullParser.END_TAG) {
6743  if (!parseDiagnosticReportContent(eventType, xpp, res))
6744        unknownContent(xpp);
6745      eventType = nextNoWhitespace(xpp);
6746    }
6747    next(xpp);
6748    parseElementClose(res);
6749    return res;
6750  }
6751
6752  protected boolean parseDiagnosticReportContent(int eventType, XmlPullParser xpp, DiagnosticReport res) throws XmlPullParserException, IOException, FHIRFormatError {
6753      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6754        res.getIdentifier().add(parseIdentifier(xpp));
6755      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("basedOn")) {
6756        res.getBasedOn().add(parseReference(xpp));
6757      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6758        res.setStatusElement(parseEnumeration(xpp, DiagnosticReport.DiagnosticReportStatus.NULL, new DiagnosticReport.DiagnosticReportStatusEnumFactory()));
6759      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
6760        res.setCategory(parseCodeableConcept(xpp));
6761      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
6762        res.setCode(parseCodeableConcept(xpp));
6763      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6764        res.setSubject(parseReference(xpp));
6765      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6766        res.setContext(parseReference(xpp));
6767      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "effective")) {
6768        res.setEffective(parseType("effective", xpp));
6769      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("issued")) {
6770        res.setIssuedElement(parseInstant(xpp));
6771      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("performer")) {
6772        res.getPerformer().add(parseDiagnosticReportDiagnosticReportPerformerComponent(xpp, res));
6773      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specimen")) {
6774        res.getSpecimen().add(parseReference(xpp));
6775      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("result")) {
6776        res.getResult().add(parseReference(xpp));
6777      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("imagingStudy")) {
6778        res.getImagingStudy().add(parseReference(xpp));
6779      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("image")) {
6780        res.getImage().add(parseDiagnosticReportDiagnosticReportImageComponent(xpp, res));
6781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("conclusion")) {
6782        res.setConclusionElement(parseString(xpp));
6783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("codedDiagnosis")) {
6784        res.getCodedDiagnosis().add(parseCodeableConcept(xpp));
6785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("presentedForm")) {
6786        res.getPresentedForm().add(parseAttachment(xpp));
6787      } else if (!parseDomainResourceContent(eventType, xpp, res))
6788        return false;
6789    return true;
6790  }
6791
6792  protected DiagnosticReport.DiagnosticReportPerformerComponent parseDiagnosticReportDiagnosticReportPerformerComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6793    DiagnosticReport.DiagnosticReportPerformerComponent res = new DiagnosticReport.DiagnosticReportPerformerComponent();
6794    parseBackboneAttributes(xpp, res);
6795    next(xpp);
6796    int eventType = nextNoWhitespace(xpp);
6797    while (eventType != XmlPullParser.END_TAG) {
6798  if (!parseDiagnosticReportDiagnosticReportPerformerComponentContent(eventType, xpp, owner, res))
6799        unknownContent(xpp);
6800      eventType = nextNoWhitespace(xpp);
6801    }
6802    next(xpp);
6803    parseElementClose(res);
6804    return res;
6805  }
6806
6807  protected boolean parseDiagnosticReportDiagnosticReportPerformerComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportPerformerComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6808      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
6809        res.setRole(parseCodeableConcept(xpp));
6810      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("actor")) {
6811        res.setActor(parseReference(xpp));
6812      } else if (!parseBackboneContent(eventType, xpp, res))
6813        return false;
6814    return true;
6815  }
6816
6817  protected DiagnosticReport.DiagnosticReportImageComponent parseDiagnosticReportDiagnosticReportImageComponent(XmlPullParser xpp, DiagnosticReport owner) throws XmlPullParserException, IOException, FHIRFormatError {
6818    DiagnosticReport.DiagnosticReportImageComponent res = new DiagnosticReport.DiagnosticReportImageComponent();
6819    parseBackboneAttributes(xpp, res);
6820    next(xpp);
6821    int eventType = nextNoWhitespace(xpp);
6822    while (eventType != XmlPullParser.END_TAG) {
6823  if (!parseDiagnosticReportDiagnosticReportImageComponentContent(eventType, xpp, owner, res))
6824        unknownContent(xpp);
6825      eventType = nextNoWhitespace(xpp);
6826    }
6827    next(xpp);
6828    parseElementClose(res);
6829    return res;
6830  }
6831
6832  protected boolean parseDiagnosticReportDiagnosticReportImageComponentContent(int eventType, XmlPullParser xpp, DiagnosticReport owner, DiagnosticReport.DiagnosticReportImageComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6833      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("comment")) {
6834        res.setCommentElement(parseString(xpp));
6835      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("link")) {
6836        res.setLink(parseReference(xpp));
6837      } else if (!parseBackboneContent(eventType, xpp, res))
6838        return false;
6839    return true;
6840  }
6841
6842  protected DocumentManifest parseDocumentManifest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6843    DocumentManifest res = new DocumentManifest();
6844    parseDomainResourceAttributes(xpp, res);
6845    next(xpp);
6846    int eventType = nextNoWhitespace(xpp);
6847    while (eventType != XmlPullParser.END_TAG) {
6848  if (!parseDocumentManifestContent(eventType, xpp, res))
6849        unknownContent(xpp);
6850      eventType = nextNoWhitespace(xpp);
6851    }
6852    next(xpp);
6853    parseElementClose(res);
6854    return res;
6855  }
6856
6857  protected boolean parseDocumentManifestContent(int eventType, XmlPullParser xpp, DocumentManifest res) throws XmlPullParserException, IOException, FHIRFormatError {
6858      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6859        res.setMasterIdentifier(parseIdentifier(xpp));
6860      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6861        res.getIdentifier().add(parseIdentifier(xpp));
6862      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6863        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6864      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6865        res.setType(parseCodeableConcept(xpp));
6866      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6867        res.setSubject(parseReference(xpp));
6868      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6869        res.setCreatedElement(parseDateTime(xpp));
6870      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6871        res.getAuthor().add(parseReference(xpp));
6872      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("recipient")) {
6873        res.getRecipient().add(parseReference(xpp));
6874      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("source")) {
6875        res.setSourceElement(parseUri(xpp));
6876      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6877        res.setDescriptionElement(parseString(xpp));
6878      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6879        res.getContent().add(parseDocumentManifestDocumentManifestContentComponent(xpp, res));
6880      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
6881        res.getRelated().add(parseDocumentManifestDocumentManifestRelatedComponent(xpp, res));
6882      } else if (!parseDomainResourceContent(eventType, xpp, res))
6883        return false;
6884    return true;
6885  }
6886
6887  protected DocumentManifest.DocumentManifestContentComponent parseDocumentManifestDocumentManifestContentComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6888    DocumentManifest.DocumentManifestContentComponent res = new DocumentManifest.DocumentManifestContentComponent();
6889    parseBackboneAttributes(xpp, res);
6890    next(xpp);
6891    int eventType = nextNoWhitespace(xpp);
6892    while (eventType != XmlPullParser.END_TAG) {
6893  if (!parseDocumentManifestDocumentManifestContentComponentContent(eventType, xpp, owner, res))
6894        unknownContent(xpp);
6895      eventType = nextNoWhitespace(xpp);
6896    }
6897    next(xpp);
6898    parseElementClose(res);
6899    return res;
6900  }
6901
6902  protected boolean parseDocumentManifestDocumentManifestContentComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6903      if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "p")) {
6904        res.setP(parseType("p", xpp));
6905      } else if (!parseBackboneContent(eventType, xpp, res))
6906        return false;
6907    return true;
6908  }
6909
6910  protected DocumentManifest.DocumentManifestRelatedComponent parseDocumentManifestDocumentManifestRelatedComponent(XmlPullParser xpp, DocumentManifest owner) throws XmlPullParserException, IOException, FHIRFormatError {
6911    DocumentManifest.DocumentManifestRelatedComponent res = new DocumentManifest.DocumentManifestRelatedComponent();
6912    parseBackboneAttributes(xpp, res);
6913    next(xpp);
6914    int eventType = nextNoWhitespace(xpp);
6915    while (eventType != XmlPullParser.END_TAG) {
6916  if (!parseDocumentManifestDocumentManifestRelatedComponentContent(eventType, xpp, owner, res))
6917        unknownContent(xpp);
6918      eventType = nextNoWhitespace(xpp);
6919    }
6920    next(xpp);
6921    parseElementClose(res);
6922    return res;
6923  }
6924
6925  protected boolean parseDocumentManifestDocumentManifestRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentManifest owner, DocumentManifest.DocumentManifestRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
6926      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6927        res.setIdentifier(parseIdentifier(xpp));
6928      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
6929        res.setRef(parseReference(xpp));
6930      } else if (!parseBackboneContent(eventType, xpp, res))
6931        return false;
6932    return true;
6933  }
6934
6935  protected DocumentReference parseDocumentReference(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
6936    DocumentReference res = new DocumentReference();
6937    parseDomainResourceAttributes(xpp, res);
6938    next(xpp);
6939    int eventType = nextNoWhitespace(xpp);
6940    while (eventType != XmlPullParser.END_TAG) {
6941  if (!parseDocumentReferenceContent(eventType, xpp, res))
6942        unknownContent(xpp);
6943      eventType = nextNoWhitespace(xpp);
6944    }
6945    next(xpp);
6946    parseElementClose(res);
6947    return res;
6948  }
6949
6950  protected boolean parseDocumentReferenceContent(int eventType, XmlPullParser xpp, DocumentReference res) throws XmlPullParserException, IOException, FHIRFormatError {
6951      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("masterIdentifier")) {
6952        res.setMasterIdentifier(parseIdentifier(xpp));
6953      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
6954        res.getIdentifier().add(parseIdentifier(xpp));
6955      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
6956        res.setStatusElement(parseEnumeration(xpp, Enumerations.DocumentReferenceStatus.NULL, new Enumerations.DocumentReferenceStatusEnumFactory()));
6957      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("docStatus")) {
6958        res.setDocStatusElement(parseEnumeration(xpp, DocumentReference.ReferredDocumentStatus.NULL, new DocumentReference.ReferredDocumentStatusEnumFactory()));
6959      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
6960        res.setType(parseCodeableConcept(xpp));
6961      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
6962        res.setClass_(parseCodeableConcept(xpp));
6963      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
6964        res.setSubject(parseReference(xpp));
6965      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
6966        res.setCreatedElement(parseDateTime(xpp));
6967      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("indexed")) {
6968        res.setIndexedElement(parseInstant(xpp));
6969      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("author")) {
6970        res.getAuthor().add(parseReference(xpp));
6971      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("authenticator")) {
6972        res.setAuthenticator(parseReference(xpp));
6973      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("custodian")) {
6974        res.setCustodian(parseReference(xpp));
6975      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relatesTo")) {
6976        res.getRelatesTo().add(parseDocumentReferenceDocumentReferenceRelatesToComponent(xpp, res));
6977      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
6978        res.setDescriptionElement(parseString(xpp));
6979      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("securityLabel")) {
6980        res.getSecurityLabel().add(parseCodeableConcept(xpp));
6981      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("content")) {
6982        res.getContent().add(parseDocumentReferenceDocumentReferenceContentComponent(xpp, res));
6983      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("context")) {
6984        res.setContext(parseDocumentReferenceDocumentReferenceContextComponent(xpp, res));
6985      } else if (!parseDomainResourceContent(eventType, xpp, res))
6986        return false;
6987    return true;
6988  }
6989
6990  protected DocumentReference.DocumentReferenceRelatesToComponent parseDocumentReferenceDocumentReferenceRelatesToComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
6991    DocumentReference.DocumentReferenceRelatesToComponent res = new DocumentReference.DocumentReferenceRelatesToComponent();
6992    parseBackboneAttributes(xpp, res);
6993    next(xpp);
6994    int eventType = nextNoWhitespace(xpp);
6995    while (eventType != XmlPullParser.END_TAG) {
6996  if (!parseDocumentReferenceDocumentReferenceRelatesToComponentContent(eventType, xpp, owner, res))
6997        unknownContent(xpp);
6998      eventType = nextNoWhitespace(xpp);
6999    }
7000    next(xpp);
7001    parseElementClose(res);
7002    return res;
7003  }
7004
7005  protected boolean parseDocumentReferenceDocumentReferenceRelatesToComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceRelatesToComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7006      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7007        res.setCodeElement(parseEnumeration(xpp, DocumentReference.DocumentRelationshipType.NULL, new DocumentReference.DocumentRelationshipTypeEnumFactory()));
7008      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("target")) {
7009        res.setTarget(parseReference(xpp));
7010      } else if (!parseBackboneContent(eventType, xpp, res))
7011        return false;
7012    return true;
7013  }
7014
7015  protected DocumentReference.DocumentReferenceContentComponent parseDocumentReferenceDocumentReferenceContentComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7016    DocumentReference.DocumentReferenceContentComponent res = new DocumentReference.DocumentReferenceContentComponent();
7017    parseBackboneAttributes(xpp, res);
7018    next(xpp);
7019    int eventType = nextNoWhitespace(xpp);
7020    while (eventType != XmlPullParser.END_TAG) {
7021  if (!parseDocumentReferenceDocumentReferenceContentComponentContent(eventType, xpp, owner, res))
7022        unknownContent(xpp);
7023      eventType = nextNoWhitespace(xpp);
7024    }
7025    next(xpp);
7026    parseElementClose(res);
7027    return res;
7028  }
7029
7030  protected boolean parseDocumentReferenceDocumentReferenceContentComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7031      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("attachment")) {
7032        res.setAttachment(parseAttachment(xpp));
7033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("format")) {
7034        res.setFormat(parseCoding(xpp));
7035      } else if (!parseBackboneContent(eventType, xpp, res))
7036        return false;
7037    return true;
7038  }
7039
7040  protected DocumentReference.DocumentReferenceContextComponent parseDocumentReferenceDocumentReferenceContextComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7041    DocumentReference.DocumentReferenceContextComponent res = new DocumentReference.DocumentReferenceContextComponent();
7042    parseBackboneAttributes(xpp, res);
7043    next(xpp);
7044    int eventType = nextNoWhitespace(xpp);
7045    while (eventType != XmlPullParser.END_TAG) {
7046  if (!parseDocumentReferenceDocumentReferenceContextComponentContent(eventType, xpp, owner, res))
7047        unknownContent(xpp);
7048      eventType = nextNoWhitespace(xpp);
7049    }
7050    next(xpp);
7051    parseElementClose(res);
7052    return res;
7053  }
7054
7055  protected boolean parseDocumentReferenceDocumentReferenceContextComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7056      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("encounter")) {
7057        res.setEncounter(parseReference(xpp));
7058      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("event")) {
7059        res.getEvent().add(parseCodeableConcept(xpp));
7060      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7061        res.setPeriod(parsePeriod(xpp));
7062      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facilityType")) {
7063        res.setFacilityType(parseCodeableConcept(xpp));
7064      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("practiceSetting")) {
7065        res.setPracticeSetting(parseCodeableConcept(xpp));
7066      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sourcePatientInfo")) {
7067        res.setSourcePatientInfo(parseReference(xpp));
7068      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
7069        res.getRelated().add(parseDocumentReferenceDocumentReferenceContextRelatedComponent(xpp, owner));
7070      } else if (!parseBackboneContent(eventType, xpp, res))
7071        return false;
7072    return true;
7073  }
7074
7075  protected DocumentReference.DocumentReferenceContextRelatedComponent parseDocumentReferenceDocumentReferenceContextRelatedComponent(XmlPullParser xpp, DocumentReference owner) throws XmlPullParserException, IOException, FHIRFormatError {
7076    DocumentReference.DocumentReferenceContextRelatedComponent res = new DocumentReference.DocumentReferenceContextRelatedComponent();
7077    parseBackboneAttributes(xpp, res);
7078    next(xpp);
7079    int eventType = nextNoWhitespace(xpp);
7080    while (eventType != XmlPullParser.END_TAG) {
7081  if (!parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(eventType, xpp, owner, res))
7082        unknownContent(xpp);
7083      eventType = nextNoWhitespace(xpp);
7084    }
7085    next(xpp);
7086    parseElementClose(res);
7087    return res;
7088  }
7089
7090  protected boolean parseDocumentReferenceDocumentReferenceContextRelatedComponentContent(int eventType, XmlPullParser xpp, DocumentReference owner, DocumentReference.DocumentReferenceContextRelatedComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7091      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7092        res.setIdentifier(parseIdentifier(xpp));
7093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("ref")) {
7094        res.setRef(parseReference(xpp));
7095      } else if (!parseBackboneContent(eventType, xpp, res))
7096        return false;
7097    return true;
7098  }
7099
7100  protected EligibilityRequest parseEligibilityRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7101    EligibilityRequest res = new EligibilityRequest();
7102    parseDomainResourceAttributes(xpp, res);
7103    next(xpp);
7104    int eventType = nextNoWhitespace(xpp);
7105    while (eventType != XmlPullParser.END_TAG) {
7106  if (!parseEligibilityRequestContent(eventType, xpp, res))
7107        unknownContent(xpp);
7108      eventType = nextNoWhitespace(xpp);
7109    }
7110    next(xpp);
7111    parseElementClose(res);
7112    return res;
7113  }
7114
7115  protected boolean parseEligibilityRequestContent(int eventType, XmlPullParser xpp, EligibilityRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7116      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7117        res.getIdentifier().add(parseIdentifier(xpp));
7118      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7119        res.setStatusElement(parseEnumeration(xpp, EligibilityRequest.EligibilityRequestStatus.NULL, new EligibilityRequest.EligibilityRequestStatusEnumFactory()));
7120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7121        res.setPriority(parseCodeableConcept(xpp));
7122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7123        res.setPatient(parseReference(xpp));
7124      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "serviced")) {
7125        res.setServiced(parseType("serviced", xpp));
7126      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7127        res.setCreatedElement(parseDateTime(xpp));
7128      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
7129        res.setEnterer(parseReference(xpp));
7130      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7131        res.setProvider(parseReference(xpp));
7132      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7133        res.setOrganization(parseReference(xpp));
7134      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7135        res.setInsurer(parseReference(xpp));
7136      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
7137        res.setFacility(parseReference(xpp));
7138      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7139        res.setCoverage(parseReference(xpp));
7140      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("businessArrangement")) {
7141        res.setBusinessArrangementElement(parseString(xpp));
7142      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitCategory")) {
7143        res.setBenefitCategory(parseCodeableConcept(xpp));
7144      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitSubCategory")) {
7145        res.setBenefitSubCategory(parseCodeableConcept(xpp));
7146      } else if (!parseDomainResourceContent(eventType, xpp, res))
7147        return false;
7148    return true;
7149  }
7150
7151  protected EligibilityResponse parseEligibilityResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7152    EligibilityResponse res = new EligibilityResponse();
7153    parseDomainResourceAttributes(xpp, res);
7154    next(xpp);
7155    int eventType = nextNoWhitespace(xpp);
7156    while (eventType != XmlPullParser.END_TAG) {
7157  if (!parseEligibilityResponseContent(eventType, xpp, res))
7158        unknownContent(xpp);
7159      eventType = nextNoWhitespace(xpp);
7160    }
7161    next(xpp);
7162    parseElementClose(res);
7163    return res;
7164  }
7165
7166  protected boolean parseEligibilityResponseContent(int eventType, XmlPullParser xpp, EligibilityResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7167      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7168        res.getIdentifier().add(parseIdentifier(xpp));
7169      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7170        res.setStatusElement(parseEnumeration(xpp, EligibilityResponse.EligibilityResponseStatus.NULL, new EligibilityResponse.EligibilityResponseStatusEnumFactory()));
7171      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7172        res.setCreatedElement(parseDateTime(xpp));
7173      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7174        res.setRequestProvider(parseReference(xpp));
7175      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7176        res.setRequestOrganization(parseReference(xpp));
7177      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7178        res.setRequest(parseReference(xpp));
7179      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7180        res.setOutcome(parseCodeableConcept(xpp));
7181      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7182        res.setDispositionElement(parseString(xpp));
7183      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7184        res.setInsurer(parseReference(xpp));
7185      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("inforce")) {
7186        res.setInforceElement(parseBoolean(xpp));
7187      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
7188        res.getInsurance().add(parseEligibilityResponseInsuranceComponent(xpp, res));
7189      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
7190        res.setForm(parseCodeableConcept(xpp));
7191      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("error")) {
7192        res.getError().add(parseEligibilityResponseErrorsComponent(xpp, res));
7193      } else if (!parseDomainResourceContent(eventType, xpp, res))
7194        return false;
7195    return true;
7196  }
7197
7198  protected EligibilityResponse.InsuranceComponent parseEligibilityResponseInsuranceComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7199    EligibilityResponse.InsuranceComponent res = new EligibilityResponse.InsuranceComponent();
7200    parseBackboneAttributes(xpp, res);
7201    next(xpp);
7202    int eventType = nextNoWhitespace(xpp);
7203    while (eventType != XmlPullParser.END_TAG) {
7204  if (!parseEligibilityResponseInsuranceComponentContent(eventType, xpp, owner, res))
7205        unknownContent(xpp);
7206      eventType = nextNoWhitespace(xpp);
7207    }
7208    next(xpp);
7209    parseElementClose(res);
7210    return res;
7211  }
7212
7213  protected boolean parseEligibilityResponseInsuranceComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7214      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7215        res.setCoverage(parseReference(xpp));
7216      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contract")) {
7217        res.setContract(parseReference(xpp));
7218      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
7219        res.getBenefitBalance().add(parseEligibilityResponseBenefitsComponent(xpp, owner));
7220      } else if (!parseBackboneContent(eventType, xpp, res))
7221        return false;
7222    return true;
7223  }
7224
7225  protected EligibilityResponse.BenefitsComponent parseEligibilityResponseBenefitsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7226    EligibilityResponse.BenefitsComponent res = new EligibilityResponse.BenefitsComponent();
7227    parseBackboneAttributes(xpp, res);
7228    next(xpp);
7229    int eventType = nextNoWhitespace(xpp);
7230    while (eventType != XmlPullParser.END_TAG) {
7231  if (!parseEligibilityResponseBenefitsComponentContent(eventType, xpp, owner, res))
7232        unknownContent(xpp);
7233      eventType = nextNoWhitespace(xpp);
7234    }
7235    next(xpp);
7236    parseElementClose(res);
7237    return res;
7238  }
7239
7240  protected boolean parseEligibilityResponseBenefitsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7241      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
7242        res.setCategory(parseCodeableConcept(xpp));
7243      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subCategory")) {
7244        res.setSubCategory(parseCodeableConcept(xpp));
7245      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excluded")) {
7246        res.setExcludedElement(parseBoolean(xpp));
7247      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7248        res.setNameElement(parseString(xpp));
7249      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7250        res.setDescriptionElement(parseString(xpp));
7251      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("network")) {
7252        res.setNetwork(parseCodeableConcept(xpp));
7253      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unit")) {
7254        res.setUnit(parseCodeableConcept(xpp));
7255      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("term")) {
7256        res.setTerm(parseCodeableConcept(xpp));
7257      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("financial")) {
7258        res.getFinancial().add(parseEligibilityResponseBenefitComponent(xpp, owner));
7259      } else if (!parseBackboneContent(eventType, xpp, res))
7260        return false;
7261    return true;
7262  }
7263
7264  protected EligibilityResponse.BenefitComponent parseEligibilityResponseBenefitComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7265    EligibilityResponse.BenefitComponent res = new EligibilityResponse.BenefitComponent();
7266    parseBackboneAttributes(xpp, res);
7267    next(xpp);
7268    int eventType = nextNoWhitespace(xpp);
7269    while (eventType != XmlPullParser.END_TAG) {
7270  if (!parseEligibilityResponseBenefitComponentContent(eventType, xpp, owner, res))
7271        unknownContent(xpp);
7272      eventType = nextNoWhitespace(xpp);
7273    }
7274    next(xpp);
7275    parseElementClose(res);
7276    return res;
7277  }
7278
7279  protected boolean parseEligibilityResponseBenefitComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.BenefitComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7280      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7281        res.setType(parseCodeableConcept(xpp));
7282      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "allowed")) {
7283        res.setAllowed(parseType("allowed", xpp));
7284      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "used")) {
7285        res.setUsed(parseType("used", xpp));
7286      } else if (!parseBackboneContent(eventType, xpp, res))
7287        return false;
7288    return true;
7289  }
7290
7291  protected EligibilityResponse.ErrorsComponent parseEligibilityResponseErrorsComponent(XmlPullParser xpp, EligibilityResponse owner) throws XmlPullParserException, IOException, FHIRFormatError {
7292    EligibilityResponse.ErrorsComponent res = new EligibilityResponse.ErrorsComponent();
7293    parseBackboneAttributes(xpp, res);
7294    next(xpp);
7295    int eventType = nextNoWhitespace(xpp);
7296    while (eventType != XmlPullParser.END_TAG) {
7297  if (!parseEligibilityResponseErrorsComponentContent(eventType, xpp, owner, res))
7298        unknownContent(xpp);
7299      eventType = nextNoWhitespace(xpp);
7300    }
7301    next(xpp);
7302    parseElementClose(res);
7303    return res;
7304  }
7305
7306  protected boolean parseEligibilityResponseErrorsComponentContent(int eventType, XmlPullParser xpp, EligibilityResponse owner, EligibilityResponse.ErrorsComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7307      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
7308        res.setCode(parseCodeableConcept(xpp));
7309      } else if (!parseBackboneContent(eventType, xpp, res))
7310        return false;
7311    return true;
7312  }
7313
7314  protected Encounter parseEncounter(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7315    Encounter res = new Encounter();
7316    parseDomainResourceAttributes(xpp, res);
7317    next(xpp);
7318    int eventType = nextNoWhitespace(xpp);
7319    while (eventType != XmlPullParser.END_TAG) {
7320  if (!parseEncounterContent(eventType, xpp, res))
7321        unknownContent(xpp);
7322      eventType = nextNoWhitespace(xpp);
7323    }
7324    next(xpp);
7325    parseElementClose(res);
7326    return res;
7327  }
7328
7329  protected boolean parseEncounterContent(int eventType, XmlPullParser xpp, Encounter res) throws XmlPullParserException, IOException, FHIRFormatError {
7330      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7331        res.getIdentifier().add(parseIdentifier(xpp));
7332      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7333        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7334      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7335        res.getStatusHistory().add(parseEncounterStatusHistoryComponent(xpp, res));
7336      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7337        res.setClass_(parseCoding(xpp));
7338      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("classHistory")) {
7339        res.getClassHistory().add(parseEncounterClassHistoryComponent(xpp, res));
7340      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7341        res.getType().add(parseCodeableConcept(xpp));
7342      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("priority")) {
7343        res.setPriority(parseCodeableConcept(xpp));
7344      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7345        res.setSubject(parseReference(xpp));
7346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("episodeOfCare")) {
7347        res.getEpisodeOfCare().add(parseReference(xpp));
7348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("incomingReferral")) {
7349        res.getIncomingReferral().add(parseReference(xpp));
7350      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("participant")) {
7351        res.getParticipant().add(parseEncounterEncounterParticipantComponent(xpp, res));
7352      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("appointment")) {
7353        res.setAppointment(parseReference(xpp));
7354      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7355        res.setPeriod(parsePeriod(xpp));
7356      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("length")) {
7357        res.setLength(parseDuration(xpp));
7358      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
7359        res.getReason().add(parseCodeableConcept(xpp));
7360      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7361        res.getDiagnosis().add(parseEncounterDiagnosisComponent(xpp, res));
7362      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7363        res.getAccount().add(parseReference(xpp));
7364      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
7365        res.setHospitalization(parseEncounterEncounterHospitalizationComponent(xpp, res));
7366      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7367        res.getLocation().add(parseEncounterEncounterLocationComponent(xpp, res));
7368      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("serviceProvider")) {
7369        res.setServiceProvider(parseReference(xpp));
7370      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("partOf")) {
7371        res.setPartOf(parseReference(xpp));
7372      } else if (!parseDomainResourceContent(eventType, xpp, res))
7373        return false;
7374    return true;
7375  }
7376
7377  protected Encounter.StatusHistoryComponent parseEncounterStatusHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7378    Encounter.StatusHistoryComponent res = new Encounter.StatusHistoryComponent();
7379    parseBackboneAttributes(xpp, res);
7380    next(xpp);
7381    int eventType = nextNoWhitespace(xpp);
7382    while (eventType != XmlPullParser.END_TAG) {
7383  if (!parseEncounterStatusHistoryComponentContent(eventType, xpp, owner, res))
7384        unknownContent(xpp);
7385      eventType = nextNoWhitespace(xpp);
7386    }
7387    next(xpp);
7388    parseElementClose(res);
7389    return res;
7390  }
7391
7392  protected boolean parseEncounterStatusHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.StatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7393      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7394        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterStatus.NULL, new Encounter.EncounterStatusEnumFactory()));
7395      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7396        res.setPeriod(parsePeriod(xpp));
7397      } else if (!parseBackboneContent(eventType, xpp, res))
7398        return false;
7399    return true;
7400  }
7401
7402  protected Encounter.ClassHistoryComponent parseEncounterClassHistoryComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7403    Encounter.ClassHistoryComponent res = new Encounter.ClassHistoryComponent();
7404    parseBackboneAttributes(xpp, res);
7405    next(xpp);
7406    int eventType = nextNoWhitespace(xpp);
7407    while (eventType != XmlPullParser.END_TAG) {
7408  if (!parseEncounterClassHistoryComponentContent(eventType, xpp, owner, res))
7409        unknownContent(xpp);
7410      eventType = nextNoWhitespace(xpp);
7411    }
7412    next(xpp);
7413    parseElementClose(res);
7414    return res;
7415  }
7416
7417  protected boolean parseEncounterClassHistoryComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.ClassHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7418      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("class")) {
7419        res.setClass_(parseCoding(xpp));
7420      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7421        res.setPeriod(parsePeriod(xpp));
7422      } else if (!parseBackboneContent(eventType, xpp, res))
7423        return false;
7424    return true;
7425  }
7426
7427  protected Encounter.EncounterParticipantComponent parseEncounterEncounterParticipantComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7428    Encounter.EncounterParticipantComponent res = new Encounter.EncounterParticipantComponent();
7429    parseBackboneAttributes(xpp, res);
7430    next(xpp);
7431    int eventType = nextNoWhitespace(xpp);
7432    while (eventType != XmlPullParser.END_TAG) {
7433  if (!parseEncounterEncounterParticipantComponentContent(eventType, xpp, owner, res))
7434        unknownContent(xpp);
7435      eventType = nextNoWhitespace(xpp);
7436    }
7437    next(xpp);
7438    parseElementClose(res);
7439    return res;
7440  }
7441
7442  protected boolean parseEncounterEncounterParticipantComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterParticipantComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7443      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7444        res.getType().add(parseCodeableConcept(xpp));
7445      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7446        res.setPeriod(parsePeriod(xpp));
7447      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("individual")) {
7448        res.setIndividual(parseReference(xpp));
7449      } else if (!parseBackboneContent(eventType, xpp, res))
7450        return false;
7451    return true;
7452  }
7453
7454  protected Encounter.DiagnosisComponent parseEncounterDiagnosisComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7455    Encounter.DiagnosisComponent res = new Encounter.DiagnosisComponent();
7456    parseBackboneAttributes(xpp, res);
7457    next(xpp);
7458    int eventType = nextNoWhitespace(xpp);
7459    while (eventType != XmlPullParser.END_TAG) {
7460  if (!parseEncounterDiagnosisComponentContent(eventType, xpp, owner, res))
7461        unknownContent(xpp);
7462      eventType = nextNoWhitespace(xpp);
7463    }
7464    next(xpp);
7465    parseElementClose(res);
7466    return res;
7467  }
7468
7469  protected boolean parseEncounterDiagnosisComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7470      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7471        res.setCondition(parseReference(xpp));
7472      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7473        res.setRole(parseCodeableConcept(xpp));
7474      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7475        res.setRankElement(parsePositiveInt(xpp));
7476      } else if (!parseBackboneContent(eventType, xpp, res))
7477        return false;
7478    return true;
7479  }
7480
7481  protected Encounter.EncounterHospitalizationComponent parseEncounterEncounterHospitalizationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7482    Encounter.EncounterHospitalizationComponent res = new Encounter.EncounterHospitalizationComponent();
7483    parseBackboneAttributes(xpp, res);
7484    next(xpp);
7485    int eventType = nextNoWhitespace(xpp);
7486    while (eventType != XmlPullParser.END_TAG) {
7487  if (!parseEncounterEncounterHospitalizationComponentContent(eventType, xpp, owner, res))
7488        unknownContent(xpp);
7489      eventType = nextNoWhitespace(xpp);
7490    }
7491    next(xpp);
7492    parseElementClose(res);
7493    return res;
7494  }
7495
7496  protected boolean parseEncounterEncounterHospitalizationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterHospitalizationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7497      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAdmissionIdentifier")) {
7498        res.setPreAdmissionIdentifier(parseIdentifier(xpp));
7499      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("origin")) {
7500        res.setOrigin(parseReference(xpp));
7501      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("admitSource")) {
7502        res.setAdmitSource(parseCodeableConcept(xpp));
7503      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reAdmission")) {
7504        res.setReAdmission(parseCodeableConcept(xpp));
7505      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dietPreference")) {
7506        res.getDietPreference().add(parseCodeableConcept(xpp));
7507      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialCourtesy")) {
7508        res.getSpecialCourtesy().add(parseCodeableConcept(xpp));
7509      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("specialArrangement")) {
7510        res.getSpecialArrangement().add(parseCodeableConcept(xpp));
7511      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("destination")) {
7512        res.setDestination(parseReference(xpp));
7513      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("dischargeDisposition")) {
7514        res.setDischargeDisposition(parseCodeableConcept(xpp));
7515      } else if (!parseBackboneContent(eventType, xpp, res))
7516        return false;
7517    return true;
7518  }
7519
7520  protected Encounter.EncounterLocationComponent parseEncounterEncounterLocationComponent(XmlPullParser xpp, Encounter owner) throws XmlPullParserException, IOException, FHIRFormatError {
7521    Encounter.EncounterLocationComponent res = new Encounter.EncounterLocationComponent();
7522    parseBackboneAttributes(xpp, res);
7523    next(xpp);
7524    int eventType = nextNoWhitespace(xpp);
7525    while (eventType != XmlPullParser.END_TAG) {
7526  if (!parseEncounterEncounterLocationComponentContent(eventType, xpp, owner, res))
7527        unknownContent(xpp);
7528      eventType = nextNoWhitespace(xpp);
7529    }
7530    next(xpp);
7531    parseElementClose(res);
7532    return res;
7533  }
7534
7535  protected boolean parseEncounterEncounterLocationComponentContent(int eventType, XmlPullParser xpp, Encounter owner, Encounter.EncounterLocationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7536      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("location")) {
7537        res.setLocation(parseReference(xpp));
7538      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7539        res.setStatusElement(parseEnumeration(xpp, Encounter.EncounterLocationStatus.NULL, new Encounter.EncounterLocationStatusEnumFactory()));
7540      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7541        res.setPeriod(parsePeriod(xpp));
7542      } else if (!parseBackboneContent(eventType, xpp, res))
7543        return false;
7544    return true;
7545  }
7546
7547  protected Endpoint parseEndpoint(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7548    Endpoint res = new Endpoint();
7549    parseDomainResourceAttributes(xpp, res);
7550    next(xpp);
7551    int eventType = nextNoWhitespace(xpp);
7552    while (eventType != XmlPullParser.END_TAG) {
7553  if (!parseEndpointContent(eventType, xpp, res))
7554        unknownContent(xpp);
7555      eventType = nextNoWhitespace(xpp);
7556    }
7557    next(xpp);
7558    parseElementClose(res);
7559    return res;
7560  }
7561
7562  protected boolean parseEndpointContent(int eventType, XmlPullParser xpp, Endpoint res) throws XmlPullParserException, IOException, FHIRFormatError {
7563      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("status")) {
7566        res.setStatusElement(parseEnumeration(xpp, Endpoint.EndpointStatus.NULL, new Endpoint.EndpointStatusEnumFactory()));
7567      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("connectionType")) {
7568        res.setConnectionType(parseCoding(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("managingOrganization")) {
7572        res.setManagingOrganization(parseReference(xpp));
7573      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7574        res.getContact().add(parseContactPoint(xpp));
7575      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7576        res.setPeriod(parsePeriod(xpp));
7577      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadType")) {
7578        res.getPayloadType().add(parseCodeableConcept(xpp));
7579      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payloadMimeType")) {
7580        res.getPayloadMimeType().add(parseCode(xpp));
7581      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("address")) {
7582        res.setAddressElement(parseUri(xpp));
7583      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("header")) {
7584        res.getHeader().add(parseString(xpp));
7585      } else if (!parseDomainResourceContent(eventType, xpp, res))
7586        return false;
7587    return true;
7588  }
7589
7590  protected EnrollmentRequest parseEnrollmentRequest(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7591    EnrollmentRequest res = new EnrollmentRequest();
7592    parseDomainResourceAttributes(xpp, res);
7593    next(xpp);
7594    int eventType = nextNoWhitespace(xpp);
7595    while (eventType != XmlPullParser.END_TAG) {
7596  if (!parseEnrollmentRequestContent(eventType, xpp, res))
7597        unknownContent(xpp);
7598      eventType = nextNoWhitespace(xpp);
7599    }
7600    next(xpp);
7601    parseElementClose(res);
7602    return res;
7603  }
7604
7605  protected boolean parseEnrollmentRequestContent(int eventType, XmlPullParser xpp, EnrollmentRequest res) throws XmlPullParserException, IOException, FHIRFormatError {
7606      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7607        res.getIdentifier().add(parseIdentifier(xpp));
7608      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7609        res.setStatusElement(parseEnumeration(xpp, EnrollmentRequest.EnrollmentRequestStatus.NULL, new EnrollmentRequest.EnrollmentRequestStatusEnumFactory()));
7610      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7611        res.setCreatedElement(parseDateTime(xpp));
7612      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
7613        res.setInsurer(parseReference(xpp));
7614      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
7615        res.setProvider(parseReference(xpp));
7616      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7617        res.setOrganization(parseReference(xpp));
7618      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subject")) {
7619        res.setSubject(parseReference(xpp));
7620      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
7621        res.setCoverage(parseReference(xpp));
7622      } else if (!parseDomainResourceContent(eventType, xpp, res))
7623        return false;
7624    return true;
7625  }
7626
7627  protected EnrollmentResponse parseEnrollmentResponse(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7628    EnrollmentResponse res = new EnrollmentResponse();
7629    parseDomainResourceAttributes(xpp, res);
7630    next(xpp);
7631    int eventType = nextNoWhitespace(xpp);
7632    while (eventType != XmlPullParser.END_TAG) {
7633  if (!parseEnrollmentResponseContent(eventType, xpp, res))
7634        unknownContent(xpp);
7635      eventType = nextNoWhitespace(xpp);
7636    }
7637    next(xpp);
7638    parseElementClose(res);
7639    return res;
7640  }
7641
7642  protected boolean parseEnrollmentResponseContent(int eventType, XmlPullParser xpp, EnrollmentResponse res) throws XmlPullParserException, IOException, FHIRFormatError {
7643      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7644        res.getIdentifier().add(parseIdentifier(xpp));
7645      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7646        res.setStatusElement(parseEnumeration(xpp, EnrollmentResponse.EnrollmentResponseStatus.NULL, new EnrollmentResponse.EnrollmentResponseStatusEnumFactory()));
7647      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("request")) {
7648        res.setRequest(parseReference(xpp));
7649      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
7650        res.setOutcome(parseCodeableConcept(xpp));
7651      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
7652        res.setDispositionElement(parseString(xpp));
7653      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
7654        res.setCreatedElement(parseDateTime(xpp));
7655      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
7656        res.setOrganization(parseReference(xpp));
7657      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestProvider")) {
7658        res.setRequestProvider(parseReference(xpp));
7659      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("requestOrganization")) {
7660        res.setRequestOrganization(parseReference(xpp));
7661      } else if (!parseDomainResourceContent(eventType, xpp, res))
7662        return false;
7663    return true;
7664  }
7665
7666  protected EpisodeOfCare parseEpisodeOfCare(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7667    EpisodeOfCare res = new EpisodeOfCare();
7668    parseDomainResourceAttributes(xpp, res);
7669    next(xpp);
7670    int eventType = nextNoWhitespace(xpp);
7671    while (eventType != XmlPullParser.END_TAG) {
7672  if (!parseEpisodeOfCareContent(eventType, xpp, res))
7673        unknownContent(xpp);
7674      eventType = nextNoWhitespace(xpp);
7675    }
7676    next(xpp);
7677    parseElementClose(res);
7678    return res;
7679  }
7680
7681  protected boolean parseEpisodeOfCareContent(int eventType, XmlPullParser xpp, EpisodeOfCare res) throws XmlPullParserException, IOException, FHIRFormatError {
7682      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7683        res.getIdentifier().add(parseIdentifier(xpp));
7684      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7685        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7686      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("statusHistory")) {
7687        res.getStatusHistory().add(parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(xpp, res));
7688      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
7689        res.getType().add(parseCodeableConcept(xpp));
7690      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
7691        res.getDiagnosis().add(parseEpisodeOfCareDiagnosisComponent(xpp, res));
7692      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
7693        res.setPatient(parseReference(xpp));
7694      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("managingOrganization")) {
7695        res.setManagingOrganization(parseReference(xpp));
7696      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7697        res.setPeriod(parsePeriod(xpp));
7698      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referralRequest")) {
7699        res.getReferralRequest().add(parseReference(xpp));
7700      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careManager")) {
7701        res.setCareManager(parseReference(xpp));
7702      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("team")) {
7703        res.getTeam().add(parseReference(xpp));
7704      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("account")) {
7705        res.getAccount().add(parseReference(xpp));
7706      } else if (!parseDomainResourceContent(eventType, xpp, res))
7707        return false;
7708    return true;
7709  }
7710
7711  protected EpisodeOfCare.EpisodeOfCareStatusHistoryComponent parseEpisodeOfCareEpisodeOfCareStatusHistoryComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7712    EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res = new EpisodeOfCare.EpisodeOfCareStatusHistoryComponent();
7713    parseBackboneAttributes(xpp, res);
7714    next(xpp);
7715    int eventType = nextNoWhitespace(xpp);
7716    while (eventType != XmlPullParser.END_TAG) {
7717  if (!parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(eventType, xpp, owner, res))
7718        unknownContent(xpp);
7719      eventType = nextNoWhitespace(xpp);
7720    }
7721    next(xpp);
7722    parseElementClose(res);
7723    return res;
7724  }
7725
7726  protected boolean parseEpisodeOfCareEpisodeOfCareStatusHistoryComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.EpisodeOfCareStatusHistoryComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7727      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7728        res.setStatusElement(parseEnumeration(xpp, EpisodeOfCare.EpisodeOfCareStatus.NULL, new EpisodeOfCare.EpisodeOfCareStatusEnumFactory()));
7729      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("period")) {
7730        res.setPeriod(parsePeriod(xpp));
7731      } else if (!parseBackboneContent(eventType, xpp, res))
7732        return false;
7733    return true;
7734  }
7735
7736  protected EpisodeOfCare.DiagnosisComponent parseEpisodeOfCareDiagnosisComponent(XmlPullParser xpp, EpisodeOfCare owner) throws XmlPullParserException, IOException, FHIRFormatError {
7737    EpisodeOfCare.DiagnosisComponent res = new EpisodeOfCare.DiagnosisComponent();
7738    parseBackboneAttributes(xpp, res);
7739    next(xpp);
7740    int eventType = nextNoWhitespace(xpp);
7741    while (eventType != XmlPullParser.END_TAG) {
7742  if (!parseEpisodeOfCareDiagnosisComponentContent(eventType, xpp, owner, res))
7743        unknownContent(xpp);
7744      eventType = nextNoWhitespace(xpp);
7745    }
7746    next(xpp);
7747    parseElementClose(res);
7748    return res;
7749  }
7750
7751  protected boolean parseEpisodeOfCareDiagnosisComponentContent(int eventType, XmlPullParser xpp, EpisodeOfCare owner, EpisodeOfCare.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7752      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("condition")) {
7753        res.setCondition(parseReference(xpp));
7754      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
7755        res.setRole(parseCodeableConcept(xpp));
7756      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("rank")) {
7757        res.setRankElement(parsePositiveInt(xpp));
7758      } else if (!parseBackboneContent(eventType, xpp, res))
7759        return false;
7760    return true;
7761  }
7762
7763  protected ExpansionProfile parseExpansionProfile(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
7764    ExpansionProfile res = new ExpansionProfile();
7765    parseDomainResourceAttributes(xpp, res);
7766    next(xpp);
7767    int eventType = nextNoWhitespace(xpp);
7768    while (eventType != XmlPullParser.END_TAG) {
7769  if (!parseExpansionProfileContent(eventType, xpp, res))
7770        unknownContent(xpp);
7771      eventType = nextNoWhitespace(xpp);
7772    }
7773    next(xpp);
7774    parseElementClose(res);
7775    return res;
7776  }
7777
7778  protected boolean parseExpansionProfileContent(int eventType, XmlPullParser xpp, ExpansionProfile res) throws XmlPullParserException, IOException, FHIRFormatError {
7779      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("url")) {
7780        res.setUrlElement(parseUri(xpp));
7781      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
7782        res.setIdentifier(parseIdentifier(xpp));
7783      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7784        res.setVersionElement(parseString(xpp));
7785      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("name")) {
7786        res.setNameElement(parseString(xpp));
7787      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
7788        res.setStatusElement(parseEnumeration(xpp, Enumerations.PublicationStatus.NULL, new Enumerations.PublicationStatusEnumFactory()));
7789      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("experimental")) {
7790        res.setExperimentalElement(parseBoolean(xpp));
7791      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
7792        res.setDateElement(parseDateTime(xpp));
7793      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("publisher")) {
7794        res.setPublisherElement(parseString(xpp));
7795      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("contact")) {
7796        res.getContact().add(parseContactDetail(xpp));
7797      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("description")) {
7798        res.setDescriptionElement(parseMarkdown(xpp));
7799      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("useContext")) {
7800        res.getUseContext().add(parseUsageContext(xpp));
7801      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("jurisdiction")) {
7802        res.getJurisdiction().add(parseCodeableConcept(xpp));
7803      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("fixedVersion")) {
7804        res.getFixedVersion().add(parseExpansionProfileExpansionProfileFixedVersionComponent(xpp, res));
7805      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludedSystem")) {
7806        res.setExcludedSystem(parseExpansionProfileExpansionProfileExcludedSystemComponent(xpp, res));
7807      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDesignations")) {
7808        res.setIncludeDesignationsElement(parseBoolean(xpp));
7809      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7810        res.setDesignation(parseExpansionProfileExpansionProfileDesignationComponent(xpp, res));
7811      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("includeDefinition")) {
7812        res.setIncludeDefinitionElement(parseBoolean(xpp));
7813      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("activeOnly")) {
7814        res.setActiveOnlyElement(parseBoolean(xpp));
7815      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNested")) {
7816        res.setExcludeNestedElement(parseBoolean(xpp));
7817      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludeNotForUI")) {
7818        res.setExcludeNotForUIElement(parseBoolean(xpp));
7819      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("excludePostCoordinated")) {
7820        res.setExcludePostCoordinatedElement(parseBoolean(xpp));
7821      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("displayLanguage")) {
7822        res.setDisplayLanguageElement(parseCode(xpp));
7823      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("limitedExpansion")) {
7824        res.setLimitedExpansionElement(parseBoolean(xpp));
7825      } else if (!parseDomainResourceContent(eventType, xpp, res))
7826        return false;
7827    return true;
7828  }
7829
7830  protected ExpansionProfile.ExpansionProfileFixedVersionComponent parseExpansionProfileExpansionProfileFixedVersionComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7831    ExpansionProfile.ExpansionProfileFixedVersionComponent res = new ExpansionProfile.ExpansionProfileFixedVersionComponent();
7832    parseBackboneAttributes(xpp, res);
7833    next(xpp);
7834    int eventType = nextNoWhitespace(xpp);
7835    while (eventType != XmlPullParser.END_TAG) {
7836  if (!parseExpansionProfileExpansionProfileFixedVersionComponentContent(eventType, xpp, owner, res))
7837        unknownContent(xpp);
7838      eventType = nextNoWhitespace(xpp);
7839    }
7840    next(xpp);
7841    parseElementClose(res);
7842    return res;
7843  }
7844
7845  protected boolean parseExpansionProfileExpansionProfileFixedVersionComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileFixedVersionComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7846      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7847        res.setSystemElement(parseUri(xpp));
7848      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7849        res.setVersionElement(parseString(xpp));
7850      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("mode")) {
7851        res.setModeElement(parseEnumeration(xpp, ExpansionProfile.SystemVersionProcessingMode.NULL, new ExpansionProfile.SystemVersionProcessingModeEnumFactory()));
7852      } else if (!parseBackboneContent(eventType, xpp, res))
7853        return false;
7854    return true;
7855  }
7856
7857  protected ExpansionProfile.ExpansionProfileExcludedSystemComponent parseExpansionProfileExpansionProfileExcludedSystemComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7858    ExpansionProfile.ExpansionProfileExcludedSystemComponent res = new ExpansionProfile.ExpansionProfileExcludedSystemComponent();
7859    parseBackboneAttributes(xpp, res);
7860    next(xpp);
7861    int eventType = nextNoWhitespace(xpp);
7862    while (eventType != XmlPullParser.END_TAG) {
7863  if (!parseExpansionProfileExpansionProfileExcludedSystemComponentContent(eventType, xpp, owner, res))
7864        unknownContent(xpp);
7865      eventType = nextNoWhitespace(xpp);
7866    }
7867    next(xpp);
7868    parseElementClose(res);
7869    return res;
7870  }
7871
7872  protected boolean parseExpansionProfileExpansionProfileExcludedSystemComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileExcludedSystemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7873      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("system")) {
7874        res.setSystemElement(parseUri(xpp));
7875      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("version")) {
7876        res.setVersionElement(parseString(xpp));
7877      } else if (!parseBackboneContent(eventType, xpp, res))
7878        return false;
7879    return true;
7880  }
7881
7882  protected ExpansionProfile.ExpansionProfileDesignationComponent parseExpansionProfileExpansionProfileDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7883    ExpansionProfile.ExpansionProfileDesignationComponent res = new ExpansionProfile.ExpansionProfileDesignationComponent();
7884    parseBackboneAttributes(xpp, res);
7885    next(xpp);
7886    int eventType = nextNoWhitespace(xpp);
7887    while (eventType != XmlPullParser.END_TAG) {
7888  if (!parseExpansionProfileExpansionProfileDesignationComponentContent(eventType, xpp, owner, res))
7889        unknownContent(xpp);
7890      eventType = nextNoWhitespace(xpp);
7891    }
7892    next(xpp);
7893    parseElementClose(res);
7894    return res;
7895  }
7896
7897  protected boolean parseExpansionProfileExpansionProfileDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.ExpansionProfileDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7898      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("include")) {
7899        res.setInclude(parseExpansionProfileDesignationIncludeComponent(xpp, owner));
7900      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("exclude")) {
7901        res.setExclude(parseExpansionProfileDesignationExcludeComponent(xpp, owner));
7902      } else if (!parseBackboneContent(eventType, xpp, res))
7903        return false;
7904    return true;
7905  }
7906
7907  protected ExpansionProfile.DesignationIncludeComponent parseExpansionProfileDesignationIncludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7908    ExpansionProfile.DesignationIncludeComponent res = new ExpansionProfile.DesignationIncludeComponent();
7909    parseBackboneAttributes(xpp, res);
7910    next(xpp);
7911    int eventType = nextNoWhitespace(xpp);
7912    while (eventType != XmlPullParser.END_TAG) {
7913  if (!parseExpansionProfileDesignationIncludeComponentContent(eventType, xpp, owner, res))
7914        unknownContent(xpp);
7915      eventType = nextNoWhitespace(xpp);
7916    }
7917    next(xpp);
7918    parseElementClose(res);
7919    return res;
7920  }
7921
7922  protected boolean parseExpansionProfileDesignationIncludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7923      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7924        res.getDesignation().add(parseExpansionProfileDesignationIncludeDesignationComponent(xpp, owner));
7925      } else if (!parseBackboneContent(eventType, xpp, res))
7926        return false;
7927    return true;
7928  }
7929
7930  protected ExpansionProfile.DesignationIncludeDesignationComponent parseExpansionProfileDesignationIncludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7931    ExpansionProfile.DesignationIncludeDesignationComponent res = new ExpansionProfile.DesignationIncludeDesignationComponent();
7932    parseBackboneAttributes(xpp, res);
7933    next(xpp);
7934    int eventType = nextNoWhitespace(xpp);
7935    while (eventType != XmlPullParser.END_TAG) {
7936  if (!parseExpansionProfileDesignationIncludeDesignationComponentContent(eventType, xpp, owner, res))
7937        unknownContent(xpp);
7938      eventType = nextNoWhitespace(xpp);
7939    }
7940    next(xpp);
7941    parseElementClose(res);
7942    return res;
7943  }
7944
7945  protected boolean parseExpansionProfileDesignationIncludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationIncludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7946      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7947        res.setLanguageElement(parseCode(xpp));
7948      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7949        res.setUse(parseCoding(xpp));
7950      } else if (!parseBackboneContent(eventType, xpp, res))
7951        return false;
7952    return true;
7953  }
7954
7955  protected ExpansionProfile.DesignationExcludeComponent parseExpansionProfileDesignationExcludeComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7956    ExpansionProfile.DesignationExcludeComponent res = new ExpansionProfile.DesignationExcludeComponent();
7957    parseBackboneAttributes(xpp, res);
7958    next(xpp);
7959    int eventType = nextNoWhitespace(xpp);
7960    while (eventType != XmlPullParser.END_TAG) {
7961  if (!parseExpansionProfileDesignationExcludeComponentContent(eventType, xpp, owner, res))
7962        unknownContent(xpp);
7963      eventType = nextNoWhitespace(xpp);
7964    }
7965    next(xpp);
7966    parseElementClose(res);
7967    return res;
7968  }
7969
7970  protected boolean parseExpansionProfileDesignationExcludeComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7971      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("designation")) {
7972        res.getDesignation().add(parseExpansionProfileDesignationExcludeDesignationComponent(xpp, owner));
7973      } else if (!parseBackboneContent(eventType, xpp, res))
7974        return false;
7975    return true;
7976  }
7977
7978  protected ExpansionProfile.DesignationExcludeDesignationComponent parseExpansionProfileDesignationExcludeDesignationComponent(XmlPullParser xpp, ExpansionProfile owner) throws XmlPullParserException, IOException, FHIRFormatError {
7979    ExpansionProfile.DesignationExcludeDesignationComponent res = new ExpansionProfile.DesignationExcludeDesignationComponent();
7980    parseBackboneAttributes(xpp, res);
7981    next(xpp);
7982    int eventType = nextNoWhitespace(xpp);
7983    while (eventType != XmlPullParser.END_TAG) {
7984  if (!parseExpansionProfileDesignationExcludeDesignationComponentContent(eventType, xpp, owner, res))
7985        unknownContent(xpp);
7986      eventType = nextNoWhitespace(xpp);
7987    }
7988    next(xpp);
7989    parseElementClose(res);
7990    return res;
7991  }
7992
7993  protected boolean parseExpansionProfileDesignationExcludeDesignationComponentContent(int eventType, XmlPullParser xpp, ExpansionProfile owner, ExpansionProfile.DesignationExcludeDesignationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
7994      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("language")) {
7995        res.setLanguageElement(parseCode(xpp));
7996      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("use")) {
7997        res.setUse(parseCoding(xpp));
7998      } else if (!parseBackboneContent(eventType, xpp, res))
7999        return false;
8000    return true;
8001  }
8002
8003  protected ExplanationOfBenefit parseExplanationOfBenefit(XmlPullParser xpp) throws XmlPullParserException, IOException, FHIRFormatError {
8004    ExplanationOfBenefit res = new ExplanationOfBenefit();
8005    parseDomainResourceAttributes(xpp, res);
8006    next(xpp);
8007    int eventType = nextNoWhitespace(xpp);
8008    while (eventType != XmlPullParser.END_TAG) {
8009  if (!parseExplanationOfBenefitContent(eventType, xpp, res))
8010        unknownContent(xpp);
8011      eventType = nextNoWhitespace(xpp);
8012    }
8013    next(xpp);
8014    parseElementClose(res);
8015    return res;
8016  }
8017
8018  protected boolean parseExplanationOfBenefitContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit res) throws XmlPullParserException, IOException, FHIRFormatError {
8019      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("identifier")) {
8020        res.getIdentifier().add(parseIdentifier(xpp));
8021      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("status")) {
8022        res.setStatusElement(parseEnumeration(xpp, ExplanationOfBenefit.ExplanationOfBenefitStatus.NULL, new ExplanationOfBenefit.ExplanationOfBenefitStatusEnumFactory()));
8023      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8024        res.setType(parseCodeableConcept(xpp));
8025      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("subType")) {
8026        res.getSubType().add(parseCodeableConcept(xpp));
8027      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("patient")) {
8028        res.setPatient(parseReference(xpp));
8029      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("billablePeriod")) {
8030        res.setBillablePeriod(parsePeriod(xpp));
8031      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("created")) {
8032        res.setCreatedElement(parseDateTime(xpp));
8033      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("enterer")) {
8034        res.setEnterer(parseReference(xpp));
8035      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurer")) {
8036        res.setInsurer(parseReference(xpp));
8037      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8038        res.setProvider(parseReference(xpp));
8039      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("organization")) {
8040        res.setOrganization(parseReference(xpp));
8041      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("referral")) {
8042        res.setReferral(parseReference(xpp));
8043      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("facility")) {
8044        res.setFacility(parseReference(xpp));
8045      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8046        res.setClaim(parseReference(xpp));
8047      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claimResponse")) {
8048        res.setClaimResponse(parseReference(xpp));
8049      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("outcome")) {
8050        res.setOutcome(parseCodeableConcept(xpp));
8051      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("disposition")) {
8052        res.setDispositionElement(parseString(xpp));
8053      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("related")) {
8054        res.getRelated().add(parseExplanationOfBenefitRelatedClaimComponent(xpp, res));
8055      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("prescription")) {
8056        res.setPrescription(parseReference(xpp));
8057      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("originalPrescription")) {
8058        res.setOriginalPrescription(parseReference(xpp));
8059      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payee")) {
8060        res.setPayee(parseExplanationOfBenefitPayeeComponent(xpp, res));
8061      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("information")) {
8062        res.getInformation().add(parseExplanationOfBenefitSupportingInformationComponent(xpp, res));
8063      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeam")) {
8064        res.getCareTeam().add(parseExplanationOfBenefitCareTeamComponent(xpp, res));
8065      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosis")) {
8066        res.getDiagnosis().add(parseExplanationOfBenefitDiagnosisComponent(xpp, res));
8067      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("procedure")) {
8068        res.getProcedure().add(parseExplanationOfBenefitProcedureComponent(xpp, res));
8069      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("precedence")) {
8070        res.setPrecedenceElement(parsePositiveInt(xpp));
8071      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("insurance")) {
8072        res.setInsurance(parseExplanationOfBenefitInsuranceComponent(xpp, res));
8073      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("accident")) {
8074        res.setAccident(parseExplanationOfBenefitAccidentComponent(xpp, res));
8075      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("employmentImpacted")) {
8076        res.setEmploymentImpacted(parsePeriod(xpp));
8077      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("hospitalization")) {
8078        res.setHospitalization(parsePeriod(xpp));
8079      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("item")) {
8080        res.getItem().add(parseExplanationOfBenefitItemComponent(xpp, res));
8081      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("addItem")) {
8082        res.getAddItem().add(parseExplanationOfBenefitAddedItemComponent(xpp, res));
8083      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalCost")) {
8084        res.setTotalCost(parseMoney(xpp));
8085      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("unallocDeductable")) {
8086        res.setUnallocDeductable(parseMoney(xpp));
8087      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("totalBenefit")) {
8088        res.setTotalBenefit(parseMoney(xpp));
8089      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("payment")) {
8090        res.setPayment(parseExplanationOfBenefitPaymentComponent(xpp, res));
8091      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("form")) {
8092        res.setForm(parseCodeableConcept(xpp));
8093      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("processNote")) {
8094        res.getProcessNote().add(parseExplanationOfBenefitNoteComponent(xpp, res));
8095      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("benefitBalance")) {
8096        res.getBenefitBalance().add(parseExplanationOfBenefitBenefitBalanceComponent(xpp, res));
8097      } else if (!parseDomainResourceContent(eventType, xpp, res))
8098        return false;
8099    return true;
8100  }
8101
8102  protected ExplanationOfBenefit.RelatedClaimComponent parseExplanationOfBenefitRelatedClaimComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8103    ExplanationOfBenefit.RelatedClaimComponent res = new ExplanationOfBenefit.RelatedClaimComponent();
8104    parseBackboneAttributes(xpp, res);
8105    next(xpp);
8106    int eventType = nextNoWhitespace(xpp);
8107    while (eventType != XmlPullParser.END_TAG) {
8108  if (!parseExplanationOfBenefitRelatedClaimComponentContent(eventType, xpp, owner, res))
8109        unknownContent(xpp);
8110      eventType = nextNoWhitespace(xpp);
8111    }
8112    next(xpp);
8113    parseElementClose(res);
8114    return res;
8115  }
8116
8117  protected boolean parseExplanationOfBenefitRelatedClaimComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.RelatedClaimComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8118      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("claim")) {
8119        res.setClaim(parseReference(xpp));
8120      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("relationship")) {
8121        res.setRelationship(parseCodeableConcept(xpp));
8122      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reference")) {
8123        res.setReference(parseIdentifier(xpp));
8124      } else if (!parseBackboneContent(eventType, xpp, res))
8125        return false;
8126    return true;
8127  }
8128
8129  protected ExplanationOfBenefit.PayeeComponent parseExplanationOfBenefitPayeeComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8130    ExplanationOfBenefit.PayeeComponent res = new ExplanationOfBenefit.PayeeComponent();
8131    parseBackboneAttributes(xpp, res);
8132    next(xpp);
8133    int eventType = nextNoWhitespace(xpp);
8134    while (eventType != XmlPullParser.END_TAG) {
8135  if (!parseExplanationOfBenefitPayeeComponentContent(eventType, xpp, owner, res))
8136        unknownContent(xpp);
8137      eventType = nextNoWhitespace(xpp);
8138    }
8139    next(xpp);
8140    parseElementClose(res);
8141    return res;
8142  }
8143
8144  protected boolean parseExplanationOfBenefitPayeeComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.PayeeComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8145      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8146        res.setType(parseCodeableConcept(xpp));
8147      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("resourceType")) {
8148        res.setResourceType(parseCodeableConcept(xpp));
8149      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("party")) {
8150        res.setParty(parseReference(xpp));
8151      } else if (!parseBackboneContent(eventType, xpp, res))
8152        return false;
8153    return true;
8154  }
8155
8156  protected ExplanationOfBenefit.SupportingInformationComponent parseExplanationOfBenefitSupportingInformationComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8157    ExplanationOfBenefit.SupportingInformationComponent res = new ExplanationOfBenefit.SupportingInformationComponent();
8158    parseBackboneAttributes(xpp, res);
8159    next(xpp);
8160    int eventType = nextNoWhitespace(xpp);
8161    while (eventType != XmlPullParser.END_TAG) {
8162  if (!parseExplanationOfBenefitSupportingInformationComponentContent(eventType, xpp, owner, res))
8163        unknownContent(xpp);
8164      eventType = nextNoWhitespace(xpp);
8165    }
8166    next(xpp);
8167    parseElementClose(res);
8168    return res;
8169  }
8170
8171  protected boolean parseExplanationOfBenefitSupportingInformationComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.SupportingInformationComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8172      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8173        res.setSequenceElement(parsePositiveInt(xpp));
8174      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("category")) {
8175        res.setCategory(parseCodeableConcept(xpp));
8176      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("code")) {
8177        res.setCode(parseCodeableConcept(xpp));
8178      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "timing")) {
8179        res.setTiming(parseType("timing", xpp));
8180      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "value")) {
8181        res.setValue(parseType("value", xpp));
8182      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("reason")) {
8183        res.setReason(parseCoding(xpp));
8184      } else if (!parseBackboneContent(eventType, xpp, res))
8185        return false;
8186    return true;
8187  }
8188
8189  protected ExplanationOfBenefit.CareTeamComponent parseExplanationOfBenefitCareTeamComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8190    ExplanationOfBenefit.CareTeamComponent res = new ExplanationOfBenefit.CareTeamComponent();
8191    parseBackboneAttributes(xpp, res);
8192    next(xpp);
8193    int eventType = nextNoWhitespace(xpp);
8194    while (eventType != XmlPullParser.END_TAG) {
8195  if (!parseExplanationOfBenefitCareTeamComponentContent(eventType, xpp, owner, res))
8196        unknownContent(xpp);
8197      eventType = nextNoWhitespace(xpp);
8198    }
8199    next(xpp);
8200    parseElementClose(res);
8201    return res;
8202  }
8203
8204  protected boolean parseExplanationOfBenefitCareTeamComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.CareTeamComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8205      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8206        res.setSequenceElement(parsePositiveInt(xpp));
8207      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("provider")) {
8208        res.setProvider(parseReference(xpp));
8209      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("responsible")) {
8210        res.setResponsibleElement(parseBoolean(xpp));
8211      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("role")) {
8212        res.setRole(parseCodeableConcept(xpp));
8213      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("qualification")) {
8214        res.setQualification(parseCodeableConcept(xpp));
8215      } else if (!parseBackboneContent(eventType, xpp, res))
8216        return false;
8217    return true;
8218  }
8219
8220  protected ExplanationOfBenefit.DiagnosisComponent parseExplanationOfBenefitDiagnosisComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8221    ExplanationOfBenefit.DiagnosisComponent res = new ExplanationOfBenefit.DiagnosisComponent();
8222    parseBackboneAttributes(xpp, res);
8223    next(xpp);
8224    int eventType = nextNoWhitespace(xpp);
8225    while (eventType != XmlPullParser.END_TAG) {
8226  if (!parseExplanationOfBenefitDiagnosisComponentContent(eventType, xpp, owner, res))
8227        unknownContent(xpp);
8228      eventType = nextNoWhitespace(xpp);
8229    }
8230    next(xpp);
8231    parseElementClose(res);
8232    return res;
8233  }
8234
8235  protected boolean parseExplanationOfBenefitDiagnosisComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.DiagnosisComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8236      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8237        res.setSequenceElement(parsePositiveInt(xpp));
8238      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "diagnosis")) {
8239        res.setDiagnosis(parseType("diagnosis", xpp));
8240      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8241        res.getType().add(parseCodeableConcept(xpp));
8242      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("packageCode")) {
8243        res.setPackageCode(parseCodeableConcept(xpp));
8244      } else if (!parseBackboneContent(eventType, xpp, res))
8245        return false;
8246    return true;
8247  }
8248
8249  protected ExplanationOfBenefit.ProcedureComponent parseExplanationOfBenefitProcedureComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8250    ExplanationOfBenefit.ProcedureComponent res = new ExplanationOfBenefit.ProcedureComponent();
8251    parseBackboneAttributes(xpp, res);
8252    next(xpp);
8253    int eventType = nextNoWhitespace(xpp);
8254    while (eventType != XmlPullParser.END_TAG) {
8255  if (!parseExplanationOfBenefitProcedureComponentContent(eventType, xpp, owner, res))
8256        unknownContent(xpp);
8257      eventType = nextNoWhitespace(xpp);
8258    }
8259    next(xpp);
8260    parseElementClose(res);
8261    return res;
8262  }
8263
8264  protected boolean parseExplanationOfBenefitProcedureComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ProcedureComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8265      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8266        res.setSequenceElement(parsePositiveInt(xpp));
8267      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8268        res.setDateElement(parseDateTime(xpp));
8269      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "procedure")) {
8270        res.setProcedure(parseType("procedure", xpp));
8271      } else if (!parseBackboneContent(eventType, xpp, res))
8272        return false;
8273    return true;
8274  }
8275
8276  protected ExplanationOfBenefit.InsuranceComponent parseExplanationOfBenefitInsuranceComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8277    ExplanationOfBenefit.InsuranceComponent res = new ExplanationOfBenefit.InsuranceComponent();
8278    parseBackboneAttributes(xpp, res);
8279    next(xpp);
8280    int eventType = nextNoWhitespace(xpp);
8281    while (eventType != XmlPullParser.END_TAG) {
8282  if (!parseExplanationOfBenefitInsuranceComponentContent(eventType, xpp, owner, res))
8283        unknownContent(xpp);
8284      eventType = nextNoWhitespace(xpp);
8285    }
8286    next(xpp);
8287    parseElementClose(res);
8288    return res;
8289  }
8290
8291  protected boolean parseExplanationOfBenefitInsuranceComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.InsuranceComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8292      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("coverage")) {
8293        res.setCoverage(parseReference(xpp));
8294      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("preAuthRef")) {
8295        res.getPreAuthRef().add(parseString(xpp));
8296      } else if (!parseBackboneContent(eventType, xpp, res))
8297        return false;
8298    return true;
8299  }
8300
8301  protected ExplanationOfBenefit.AccidentComponent parseExplanationOfBenefitAccidentComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8302    ExplanationOfBenefit.AccidentComponent res = new ExplanationOfBenefit.AccidentComponent();
8303    parseBackboneAttributes(xpp, res);
8304    next(xpp);
8305    int eventType = nextNoWhitespace(xpp);
8306    while (eventType != XmlPullParser.END_TAG) {
8307  if (!parseExplanationOfBenefitAccidentComponentContent(eventType, xpp, owner, res))
8308        unknownContent(xpp);
8309      eventType = nextNoWhitespace(xpp);
8310    }
8311    next(xpp);
8312    parseElementClose(res);
8313    return res;
8314  }
8315
8316  protected boolean parseExplanationOfBenefitAccidentComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.AccidentComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8317      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("date")) {
8318        res.setDateElement(parseDate(xpp));
8319      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("type")) {
8320        res.setType(parseCodeableConcept(xpp));
8321      } else if (eventType == XmlPullParser.START_TAG && nameIsTypeName(xpp, "location")) {
8322        res.setLocation(parseType("location", xpp));
8323      } else if (!parseBackboneContent(eventType, xpp, res))
8324        return false;
8325    return true;
8326  }
8327
8328  protected ExplanationOfBenefit.ItemComponent parseExplanationOfBenefitItemComponent(XmlPullParser xpp, ExplanationOfBenefit owner) throws XmlPullParserException, IOException, FHIRFormatError {
8329    ExplanationOfBenefit.ItemComponent res = new ExplanationOfBenefit.ItemComponent();
8330    parseBackboneAttributes(xpp, res);
8331    next(xpp);
8332    int eventType = nextNoWhitespace(xpp);
8333    while (eventType != XmlPullParser.END_TAG) {
8334  if (!parseExplanationOfBenefitItemComponentContent(eventType, xpp, owner, res))
8335        unknownContent(xpp);
8336      eventType = nextNoWhitespace(xpp);
8337    }
8338    next(xpp);
8339    parseElementClose(res);
8340    return res;
8341  }
8342
8343  protected boolean parseExplanationOfBenefitItemComponentContent(int eventType, XmlPullParser xpp, ExplanationOfBenefit owner, ExplanationOfBenefit.ItemComponent res) throws XmlPullParserException, IOException, FHIRFormatError {
8344      if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("sequence")) {
8345        res.setSequenceElement(parsePositiveInt(xpp));
8346      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("careTeamLinkId")) {
8347        res.getCareTeamLinkId().add(parsePositiveInt(xpp));
8348      } else if (eventType == XmlPullParser.START_TAG && xpp.getName().equals("diagnosisLinkId")) {
8349        res.getDiagnosisLinkId().add(parsePositiveInt(xpp));