Jeff Lavallee avatar Jeff Lavallee committed 2fcaf90

flightaware WSDL and generated code

client code generated using scalaxb command line client
fork https://github.com/jlavallee/scalaxb
from async branch commit e665bda6a529f3f824ae346c6eb7f454349c288e
using command
run -d /Users/jeff/Code/flightaware-client-scala/src/main/scala -p com.zeroclue.flightaware.client --dispatch-version 0.10.0 /Users/jeff/Code/flightaware-client-scala/src/main/wsdl/flightaware_2.0.wsdl
at sbt prompt in project cli

Comments (0)

Files changed (10)

src/main/scala/flightaware_2.0.scala

+// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
+package com.zeroclue.flightaware.client
+
+
+trait FlightXML2Soap {
+  def aircraftType(typeValue: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.AircraftTypeStruct]]
+  def airlineFlightInfo(faFlightID: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.AirlineFlightInfoStruct]]
+  def airlineFlightSchedules(startDate: Int, endDate: Int, origin: String, destination: String, airline: String, flightno: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfAirlineFlightScheduleStruct]]
+  def airlineInfo(airlineCode: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.AirlineInfoStruct]]
+  def airlineInsight(origin: String, destination: String, reportType: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfAirlineInsightStruct]]
+  def airportInfo(airportCode: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.AirportInfoStruct]]
+  def allAirlines(): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfString]]
+  def allAirports(): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfString]]
+  def arrived(airport: String, howMany: Int, filter: String, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrivalStruct]]
+  def blockIdentCheck(ident: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def countAirportOperations(airport: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.CountAirportOperationsStruct]]
+  def countAllEnrouteAirlineOperations(): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfCountAirlineOperationsStruct]]
+  def decodeFlightRoute(faFlightID: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfFlightRouteStruct]]
+  def decodeRoute(origin: String, route: String, destination: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfFlightRouteStruct]]
+  def deleteAlert(alert_id: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def departed(airport: String, howMany: Int, filter: String, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.DepartureStruct]]
+  def enroute(airport: String, howMany: Int, filter: String, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.EnrouteStruct]]
+  def fleetArrived(fleet: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrivalStruct]]
+  def fleetScheduled(fleet: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ScheduledStruct]]
+  def flightInfo(ident: String, howMany: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.FlightInfoStruct]]
+  def flightInfoEx(ident: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.FlightInfoExStruct]]
+  def getAlerts(): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.FlightAlertListing]]
+  def getFlightID(ident: String, departureTime: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], String]]
+  def getHistoricalTrack(faFlightID: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfTrackStruct]]
+  def getLastTrack(ident: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfTrackStruct]]
+  def inboundFlightInfo(faFlightID: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.FlightExStruct]]
+  def inFlightInfo(ident: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.InFlightAircraftStruct]]
+  def latLongsToDistance(lat1: Float, lon1: Float, lat2: Float, lon2: Float): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def latLongsToHeading(lat1: Float, lon1: Float, lat2: Float, lon2: Float): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def mapFlight(ident: String, mapHeight: Int, mapWidth: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], String]]
+  def mapFlightEx(faFlightID: String, mapHeight: Int, mapWidth: Int, layer_on: Seq[String], layer_off: Seq[String], show_data_blocks: Boolean, show_airports: Boolean, airports_expand_view: Boolean, latlon_box: Seq[Float]): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], String]]
+  def metar(airport: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], String]]
+  def metarEx(airport: String, startTime: Int, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfMetarStruct]]
+  def nTaf(airport: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.TafStruct]]
+  def registerAlertEndpoint(address: String, format_type: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def routesBetweenAirports(origin: String, destination: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfRoutesBetweenAirportsStruct]]
+  def routesBetweenAirportsEx(origin: String, destination: String, howMany: Int, offset: Int, maxDepartureAge: String, maxFileAge: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfRoutesBetweenAirportsExStruct]]
+  def scheduled(airport: String, howMany: Int, filter: String, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ScheduledStruct]]
+  def search(query: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.InFlightStruct]]
+  def searchBirdseyeInFlight(query: String, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.InFlightStruct]]
+  def searchBirdseyePositions(query: String, uniqueFlights: Boolean, howMany: Int, offset: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ArrayOfTrackExStruct]]
+  def searchCount(query: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def setAlert(alert_id: Int, ident: String, origin: String, destination: String, aircrafttype: String, date_start: Int, date_end: Int, channels: String, enabled: Boolean, max_weekly: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def setMaximumResultSize(max_size: Int): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], Int]]
+  def taf(airport: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], String]]
+  def tailOwner(ident: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.TailOwnerStruct]]
+  def zipcodeInfo(zipcode: String): scala.concurrent.Future[Either[scalaxb.Soap11Fault[Any], com.zeroclue.flightaware.client.ZipcodeInfoStruct]]
+}
+
+
+
+

src/main/scala/flightaware_2.0_type1.scala

+// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
+package com.zeroclue.flightaware.client
+
+
+case class AircraftTypeRequest(typeValue: String)
+
+
+case class AircraftTypeResults(AircraftTypeResult: com.zeroclue.flightaware.client.AircraftTypeStruct)
+
+
+case class AircraftTypeStruct(manufacturer: String,
+  typeValue: String,
+  description: String)
+
+
+case class AirlineFlightInfoRequest(faFlightID: String)
+
+
+case class AirlineFlightInfoResults(AirlineFlightInfoResult: com.zeroclue.flightaware.client.AirlineFlightInfoStruct)
+
+
+case class AirlineFlightInfoStruct(faFlightID: String,
+  ident: String,
+  codeshares: Seq[String] = Nil,
+  tailnumber: String,
+  meal_service: String,
+  gate_orig: String,
+  gate_dest: String,
+  terminal_orig: String,
+  terminal_dest: String,
+  bag_claim: String,
+  seats_cabin_first: Int,
+  seats_cabin_business: Int,
+  seats_cabin_coach: Int)
+
+
+case class AirlineFlightSchedulesRequest(startDate: Int,
+  endDate: Int,
+  origin: String,
+  destination: String,
+  airline: String,
+  flightno: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class AirlineFlightSchedulesResults(AirlineFlightSchedulesResult: com.zeroclue.flightaware.client.ArrayOfAirlineFlightScheduleStruct)
+
+
+case class AirlineFlightScheduleStruct(ident: String,
+  actual_ident: String,
+  departuretime: Int,
+  arrivaltime: Int,
+  origin: String,
+  destination: String,
+  aircrafttype: String,
+  meal_service: String,
+  seats_cabin_first: Int,
+  seats_cabin_business: Int,
+  seats_cabin_coach: Int)
+
+
+case class AirlineInfoRequest(airlineCode: String)
+
+
+case class AirlineInfoResults(AirlineInfoResult: com.zeroclue.flightaware.client.AirlineInfoStruct)
+
+
+case class AirlineInfoStruct(name: String,
+  shortname: String,
+  callsign: String,
+  location: String,
+  country: String,
+  url: String,
+  phone: String)
+
+
+case class AirlineInsightRequest(origin: String,
+  destination: String,
+  reportType: Int)
+
+
+case class AirlineInsightResults(AirlineInsightResult: com.zeroclue.flightaware.client.ArrayOfAirlineInsightStruct)
+
+
+case class AirlineInsightStruct(origin: String,
+  layover: String,
+  destination: String,
+  carrier: String,
+  opcarrier: String,
+  flights_scheduled: Int,
+  flights_performed: Int,
+  total_passengers: Int,
+  total_seats: Int,
+  total_payload: Int,
+  total_mail: Int,
+  percent: Float,
+  fare_min: String,
+  fare_median: String,
+  fare_max: String)
+
+
+case class AirportInfoRequest(airportCode: String)
+
+
+case class AirportInfoResults(AirportInfoResult: com.zeroclue.flightaware.client.AirportInfoStruct)
+
+
+case class AirportInfoStruct(name: String,
+  location: String,
+  longitude: Float,
+  latitude: Float,
+  timezone: String)
+
+
+case class AllAirlinesRequest()
+
+
+case class AllAirlinesResults(AllAirlinesResult: com.zeroclue.flightaware.client.ArrayOfString)
+
+
+case class AllAirportsRequest()
+
+
+case class AllAirportsResults(AllAirportsResult: com.zeroclue.flightaware.client.ArrayOfString)
+
+
+case class ArrayOfAirlineFlightScheduleStruct(next_offset: Int,
+  data: Seq[com.zeroclue.flightaware.client.AirlineFlightScheduleStruct] = Nil)
+
+
+case class ArrayOfAirlineInsightStruct(data: Seq[com.zeroclue.flightaware.client.AirlineInsightStruct] = Nil,
+  start_date: Int,
+  end_date: Int)
+
+
+case class ArrayOfCountAirlineOperationsStruct(data: com.zeroclue.flightaware.client.CountAirlineOperationsStruct*)
+
+
+case class ArrayOfFlightRouteStruct(next_offset: Int,
+  data: Seq[com.zeroclue.flightaware.client.FlightRouteStruct] = Nil)
+
+
+case class ArrayOfMetarStruct(next_offset: Int,
+  metar: Seq[com.zeroclue.flightaware.client.MetarStruct] = Nil)
+
+
+case class ArrayOfRoutesBetweenAirportsExStruct(next_offset: Int,
+  data: Seq[com.zeroclue.flightaware.client.RoutesBetweenAirportsExStruct] = Nil)
+
+
+case class ArrayOfRoutesBetweenAirportsStruct(data: com.zeroclue.flightaware.client.RoutesBetweenAirportsStruct*)
+
+
+case class ArrayOfString(data: String*)
+
+
+case class ArrayOfTrackExStruct(next_offset: Int,
+  data: Seq[com.zeroclue.flightaware.client.TrackExStruct] = Nil)
+
+
+case class ArrayOfTrackStruct(data: com.zeroclue.flightaware.client.TrackStruct*)
+
+
+case class ArrivalFlightStruct(ident: String,
+  aircrafttype: String,
+  actualdeparturetime: Int,
+  actualarrivaltime: Int,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class ArrivalStruct(next_offset: Int,
+  arrivals: Seq[com.zeroclue.flightaware.client.ArrivalFlightStruct] = Nil)
+
+
+case class ArrivedRequest(airport: String,
+  howMany: Int,
+  filter: String,
+  offset: Int)
+
+
+case class ArrivedResults(ArrivedResult: com.zeroclue.flightaware.client.ArrivalStruct)
+
+
+case class BlockIdentCheckRequest(ident: String)
+
+
+case class BlockIdentCheckResults(BlockIdentCheckResult: Int)
+
+
+case class CountAirlineOperationsStruct(icao: String,
+  name: String,
+  enroute: Int)
+
+
+case class CountAirportOperationsRequest(airport: String)
+
+
+case class CountAirportOperationsResults(CountAirportOperationsResult: com.zeroclue.flightaware.client.CountAirportOperationsStruct)
+
+
+case class CountAirportOperationsStruct(enroute: Int,
+  departed: Int,
+  scheduled_departures: Int,
+  scheduled_arrivals: Int)
+
+
+case class CountAllEnrouteAirlineOperationsRequest()
+
+
+case class CountAllEnrouteAirlineOperationsResults(CountAllEnrouteAirlineOperationsResult: com.zeroclue.flightaware.client.ArrayOfCountAirlineOperationsStruct)
+
+
+case class DecodeFlightRouteRequest(faFlightID: String)
+
+
+case class DecodeFlightRouteResults(DecodeFlightRouteResult: com.zeroclue.flightaware.client.ArrayOfFlightRouteStruct)
+
+
+case class DecodeRouteRequest(origin: String,
+  route: String,
+  destination: String)
+
+
+case class DecodeRouteResults(DecodeRouteResult: com.zeroclue.flightaware.client.ArrayOfFlightRouteStruct)
+
+
+case class DeleteAlertRequest(alert_id: Int)
+
+
+case class DeleteAlertResults(DeleteAlertResult: Int)
+
+
+case class DepartedRequest(airport: String,
+  howMany: Int,
+  filter: String,
+  offset: Int)
+
+
+case class DepartedResults(DepartedResult: com.zeroclue.flightaware.client.DepartureStruct)
+
+
+case class DepartureFlightStruct(ident: String,
+  aircrafttype: String,
+  actualdeparturetime: Int,
+  estimatedarrivaltime: Int,
+  actualarrivaltime: Int,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class DepartureStruct(next_offset: Int,
+  departures: Seq[com.zeroclue.flightaware.client.DepartureFlightStruct] = Nil)
+
+
+case class EnrouteFlightStruct(ident: String,
+  aircrafttype: String,
+  actualdeparturetime: Int,
+  estimatedarrivaltime: Int,
+  filed_departuretime: Int,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class EnrouteRequest(airport: String,
+  howMany: Int,
+  filter: String,
+  offset: Int)
+
+
+case class EnrouteResults(EnrouteResult: com.zeroclue.flightaware.client.EnrouteStruct)
+
+
+case class EnrouteStruct(next_offset: Int,
+  enroute: Seq[com.zeroclue.flightaware.client.EnrouteFlightStruct] = Nil)
+
+
+case class FleetArrivedRequest(fleet: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class FleetArrivedResults(FleetArrivedResult: com.zeroclue.flightaware.client.ArrivalStruct)
+
+
+case class FleetScheduledRequest(fleet: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class FleetScheduledResults(FleetScheduledResult: com.zeroclue.flightaware.client.ScheduledStruct)
+
+
+case class FlightAlertChannel(channel_id: Int,
+  channel_name: String,
+  mask_summary: String,
+  e_filed: Boolean,
+  e_departure: Boolean,
+  e_arrival: Boolean,
+  e_diverted: Boolean,
+  e_cancelled: Boolean,
+  target_address: String)
+
+
+case class FlightAlertEntry(alert_id: Int,
+  enabled: Boolean,
+  description: String,
+  typeValue: String,
+  ident: String,
+  user_ident: String,
+  aircrafttype: String,
+  origin: String,
+  destination: String,
+  date_start: Int,
+  date_end: Int,
+  channels: Seq[com.zeroclue.flightaware.client.FlightAlertChannel] = Nil,
+  alert_created: Int,
+  alert_changed: Int)
+
+
+case class FlightAlertListing(num_alerts: Int,
+  alerts: Seq[com.zeroclue.flightaware.client.FlightAlertEntry] = Nil)
+
+
+case class FlightExStruct(faFlightID: String,
+  ident: String,
+  aircrafttype: String,
+  filed_ete: String,
+  filed_time: Int,
+  filed_departuretime: Int,
+  filed_airspeed_kts: Int,
+  filed_airspeed_mach: String,
+  filed_altitude: Int,
+  route: String,
+  actualdeparturetime: Int,
+  estimatedarrivaltime: Int,
+  actualarrivaltime: Int,
+  diverted: String,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class FlightInfoExRequest(ident: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class FlightInfoExResults(FlightInfoExResult: com.zeroclue.flightaware.client.FlightInfoExStruct)
+
+
+case class FlightInfoExStruct(next_offset: Int,
+  flights: Seq[com.zeroclue.flightaware.client.FlightExStruct] = Nil)
+
+
+case class FlightInfoRequest(ident: String,
+  howMany: Int)
+
+
+case class FlightInfoResults(FlightInfoResult: com.zeroclue.flightaware.client.FlightInfoStruct)
+
+
+case class FlightInfoStruct(next_offset: Int,
+  flights: Seq[com.zeroclue.flightaware.client.FlightStruct] = Nil)
+
+
+case class FlightRouteStruct(name: String,
+  typeValue: String,
+  latitude: Float,
+  longitude: Float)
+
+
+case class FlightStruct(ident: String,
+  aircrafttype: String,
+  filed_ete: String,
+  filed_time: Int,
+  filed_departuretime: Int,
+  filed_airspeed_kts: Int,
+  filed_airspeed_mach: String,
+  filed_altitude: Int,
+  route: String,
+  actualdeparturetime: Int,
+  estimatedarrivaltime: Int,
+  actualarrivaltime: Int,
+  diverted: String,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class GetAlertsRequest()
+
+
+case class GetAlertsResults(GetAlertsResult: com.zeroclue.flightaware.client.FlightAlertListing)
+
+
+case class GetFlightIDRequest(ident: String,
+  departureTime: Int)
+
+
+case class GetFlightIDResults(GetFlightIDResult: String)
+
+
+case class GetHistoricalTrackRequest(faFlightID: String)
+
+
+case class GetHistoricalTrackResults(GetHistoricalTrackResult: com.zeroclue.flightaware.client.ArrayOfTrackStruct)
+
+
+case class GetLastTrackRequest(ident: String)
+
+
+case class GetLastTrackResults(GetLastTrackResult: com.zeroclue.flightaware.client.ArrayOfTrackStruct)
+
+
+case class InboundFlightInfoRequest(faFlightID: String)
+
+
+case class InboundFlightInfoResults(InboundFlightInfoResult: com.zeroclue.flightaware.client.FlightExStruct)
+
+
+case class InFlightAircraftStruct(inflightaircraftstructsequence1: com.zeroclue.flightaware.client.InFlightAircraftStructSequence1,
+  inflightaircraftstructsequence2: com.zeroclue.flightaware.client.InFlightAircraftStructSequence2,
+  inflightaircraftstructsequence3: com.zeroclue.flightaware.client.InFlightAircraftStructSequence3) {
+  lazy val faFlightID = inflightaircraftstructsequence1.faFlightID
+  lazy val ident = inflightaircraftstructsequence1.ident
+  lazy val prefix = inflightaircraftstructsequence1.prefix
+  lazy val typeValue = inflightaircraftstructsequence1.typeValue
+  lazy val suffix = inflightaircraftstructsequence1.suffix
+  lazy val origin = inflightaircraftstructsequence1.origin
+  lazy val destination = inflightaircraftstructsequence1.destination
+  lazy val timeout = inflightaircraftstructsequence1.timeout
+  lazy val timestamp = inflightaircraftstructsequence1.timestamp
+  lazy val departureTime = inflightaircraftstructsequence1.departureTime
+  lazy val firstPositionTime = inflightaircraftstructsequence2.firstPositionTime
+  lazy val arrivalTime = inflightaircraftstructsequence2.arrivalTime
+  lazy val longitude = inflightaircraftstructsequence2.longitude
+  lazy val latitude = inflightaircraftstructsequence2.latitude
+  lazy val lowLongitude = inflightaircraftstructsequence2.lowLongitude
+  lazy val lowLatitude = inflightaircraftstructsequence2.lowLatitude
+  lazy val highLongitude = inflightaircraftstructsequence2.highLongitude
+  lazy val highLatitude = inflightaircraftstructsequence2.highLatitude
+  lazy val groundspeed = inflightaircraftstructsequence2.groundspeed
+  lazy val altitude = inflightaircraftstructsequence2.altitude
+  lazy val heading = inflightaircraftstructsequence3.heading
+  lazy val altitudeStatus = inflightaircraftstructsequence3.altitudeStatus
+  lazy val updateType = inflightaircraftstructsequence3.updateType
+  lazy val altitudeChange = inflightaircraftstructsequence3.altitudeChange
+  lazy val waypoints = inflightaircraftstructsequence3.waypoints
+}
+
+
+case class InFlightAircraftStructSequence1(faFlightID: String,
+  ident: String,
+  prefix: String,
+  typeValue: String,
+  suffix: String,
+  origin: String,
+  destination: String,
+  timeout: String,
+  timestamp: Int,
+  departureTime: Int)
+
+case class InFlightAircraftStructSequence2(firstPositionTime: Int,
+  arrivalTime: Int,
+  longitude: Float,
+  latitude: Float,
+  lowLongitude: Float,
+  lowLatitude: Float,
+  highLongitude: Float,
+  highLatitude: Float,
+  groundspeed: Int,
+  altitude: Int)
+
+case class InFlightAircraftStructSequence3(heading: Int,
+  altitudeStatus: String,
+  updateType: String,
+  altitudeChange: String,
+  waypoints: String)
+
+
+case class InFlightInfoRequest(ident: String)
+
+
+case class InFlightInfoResults(InFlightInfoResult: com.zeroclue.flightaware.client.InFlightAircraftStruct)
+
+
+case class InFlightStruct(next_offset: Int,
+  aircraft: Seq[com.zeroclue.flightaware.client.InFlightAircraftStruct] = Nil)
+
+
+case class LatLongsToDistanceRequest(lat1: Float,
+  lon1: Float,
+  lat2: Float,
+  lon2: Float)
+
+
+case class LatLongsToDistanceResults(LatLongsToDistanceResult: Int)
+
+
+case class LatLongsToHeadingRequest(lat1: Float,
+  lon1: Float,
+  lat2: Float,
+  lon2: Float)
+
+
+case class LatLongsToHeadingResults(LatLongsToHeadingResult: Int)
+
+
+case class MapFlightExRequest(faFlightID: String,
+  mapHeight: Int,
+  mapWidth: Int,
+  layer_on: Seq[String] = Nil,
+  layer_off: Seq[String] = Nil,
+  show_data_blocks: Boolean,
+  show_airports: Boolean,
+  airports_expand_view: Boolean,
+  latlon_box: Seq[Float] = Nil)
+
+
+case class MapFlightExResults(MapFlightExResult: String)
+
+
+case class MapFlightRequest(ident: String,
+  mapHeight: Int,
+  mapWidth: Int)
+
+
+case class MapFlightResults(MapFlightResult: String)
+
+
+case class MetarExRequest(airport: String,
+  startTime: Int,
+  howMany: Int,
+  offset: Int)
+
+
+case class MetarExResults(MetarExResult: com.zeroclue.flightaware.client.ArrayOfMetarStruct)
+
+
+case class MetarRequest(airport: String)
+
+
+case class MetarResults(MetarResult: String)
+
+
+case class MetarStruct(airport: String,
+  time: Int,
+  cloud_friendly: String,
+  cloud_altitude: Int,
+  cloud_type: String,
+  conditions: String,
+  pressure: Float,
+  temp_air: Int,
+  temp_dewpoint: Int,
+  temp_relhum: Int,
+  visibility: Float,
+  wind_friendly: String,
+  wind_direction: Int,
+  wind_speed: Int,
+  wind_speed_gust: Int,
+  raw_data: String)
+
+
+case class NTafRequest(airport: String)
+
+
+case class NTafResults(NTafResult: com.zeroclue.flightaware.client.TafStruct)
+
+
+case class RegisterAlertEndpointRequest(address: String,
+  format_type: String)
+
+
+case class RegisterAlertEndpointResults(RegisterAlertEndpointResult: Int)
+
+
+case class RoutesBetweenAirportsExRequest(origin: String,
+  destination: String,
+  howMany: Int,
+  offset: Int,
+  maxDepartureAge: String,
+  maxFileAge: String)
+
+
+case class RoutesBetweenAirportsExResults(RoutesBetweenAirportsExResult: com.zeroclue.flightaware.client.ArrayOfRoutesBetweenAirportsExStruct)
+
+
+case class RoutesBetweenAirportsExStruct(count: Int,
+  route: String,
+  filedAltitude_min: Int,
+  filedAltitude_max: Int,
+  last_departuretime: Int)
+
+
+case class RoutesBetweenAirportsRequest(origin: String,
+  destination: String)
+
+
+case class RoutesBetweenAirportsResults(RoutesBetweenAirportsResult: com.zeroclue.flightaware.client.ArrayOfRoutesBetweenAirportsStruct)
+
+
+case class RoutesBetweenAirportsStruct(count: Int,
+  route: String,
+  filedAltitude: Int)
+
+
+case class ScheduledFlightStruct(ident: String,
+  aircrafttype: String,
+  filed_departuretime: Int,
+  estimatedarrivaltime: Int,
+  origin: String,
+  destination: String,
+  originName: String,
+  originCity: String,
+  destinationName: String,
+  destinationCity: String)
+
+
+case class ScheduledRequest(airport: String,
+  howMany: Int,
+  filter: String,
+  offset: Int)
+
+
+case class ScheduledResults(ScheduledResult: com.zeroclue.flightaware.client.ScheduledStruct)
+
+
+case class ScheduledStruct(next_offset: Int,
+  scheduled: Seq[com.zeroclue.flightaware.client.ScheduledFlightStruct] = Nil)
+
+
+case class SearchBirdseyeInFlightRequest(query: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class SearchBirdseyeInFlightResults(SearchBirdseyeInFlightResult: com.zeroclue.flightaware.client.InFlightStruct)
+
+
+case class SearchBirdseyePositionsRequest(query: String,
+  uniqueFlights: Boolean,
+  howMany: Int,
+  offset: Int)
+
+
+case class SearchBirdseyePositionsResults(SearchBirdseyePositionsResult: com.zeroclue.flightaware.client.ArrayOfTrackExStruct)
+
+
+case class SearchCountRequest(query: String)
+
+
+case class SearchCountResults(SearchCountResult: Int)
+
+
+case class SearchRequest(query: String,
+  howMany: Int,
+  offset: Int)
+
+
+case class SearchResults(SearchResult: com.zeroclue.flightaware.client.InFlightStruct)
+
+
+case class SetAlertRequest(alert_id: Int,
+  ident: String,
+  origin: String,
+  destination: String,
+  aircrafttype: String,
+  date_start: Int,
+  date_end: Int,
+  channels: String,
+  enabled: Boolean,
+  max_weekly: Int)
+
+
+case class SetAlertResults(SetAlertResult: Int)
+
+
+case class SetMaximumResultSizeRequest(max_size: Int)
+
+
+case class SetMaximumResultSizeResults(SetMaximumResultSizeResult: Int)
+
+
+case class TafRequest(airport: String)
+
+
+case class TafResults(TafResult: String)
+
+
+case class TafStruct(airport: String,
+  timeString: String,
+  forecast: Seq[String] = Nil)
+
+
+case class TailOwnerRequest(ident: String)
+
+
+case class TailOwnerResults(TailOwnerResult: com.zeroclue.flightaware.client.TailOwnerStruct)
+
+
+case class TailOwnerStruct(owner: String,
+  location: String,
+  location2: String,
+  website: String)
+
+
+case class TrackExStruct(faFlightID: String,
+  timestamp: Int,
+  latitude: Float,
+  longitude: Float,
+  groundspeed: Int,
+  altitude: Int,
+  altitudeStatus: String,
+  updateType: String,
+  altitudeChange: String)
+
+
+case class TrackStruct(timestamp: Int,
+  latitude: Float,
+  longitude: Float,
+  groundspeed: Int,
+  altitude: Int,
+  altitudeStatus: String,
+  updateType: String,
+  altitudeChange: String)
+
+
+case class ZipcodeInfoRequest(zipcode: String)
+
+
+case class ZipcodeInfoResults(ZipcodeInfoResult: com.zeroclue.flightaware.client.ZipcodeInfoStruct)
+
+
+case class ZipcodeInfoStruct(latitude: Float,
+  longitude: Float,
+  city: String,
+  state: String,
+  county: String)
+

src/main/scala/httpclients.scala

+package scalaxb
+
+trait HttpClients {
+  def httpClient: HttpClient
+
+  trait HttpClient {
+    def request(in: String, address: java.net.URI, headers: Map[String, String]): scala.concurrent.Future[String]
+  }
+}

src/main/scala/httpclients_dispatch.scala

+package scalaxb
+
+trait DispatchHttpClients extends HttpClients {
+  lazy val httpClient = new DispatchHttpClient {}
+
+  trait DispatchHttpClient extends HttpClient {
+    import dispatch._, Defaults._
+
+    def request(in: String, address: java.net.URI, headers: Map[String, String]): scala.concurrent.Future[String] = {
+      val req = url(address.toString) << in <:< headers
+      Http(req > as.String)
+    }
+  }
+}

src/main/scala/scalaxb.scala

+package scalaxb
+
+import scala.xml.{Node, NodeSeq, NamespaceBinding, Elem, UnprefixedAttribute, PrefixedAttribute}
+import javax.xml.datatype.{XMLGregorianCalendar}
+import javax.xml.namespace.QName
+import javax.xml.bind.DatatypeConverter
+
+object `package` {
+  import annotation.implicitNotFound
+
+  @implicitNotFound(msg = "Cannot find XMLFormat type class for ${A}")
+  def fromXML[A](seq: NodeSeq, stack: List[ElemName] = Nil)
+                (implicit format: XMLFormat[A]): A = format.reads(seq, stack) match {
+    case Right(a) => a
+    case Left(a) => throw new ParserFailure("Error while parsing %s: %s" format(seq.toString, a))
+  }
+
+  @implicitNotFound(msg = "Cannot find XMLFormat type class for ${A}")
+  def fromXMLEither[A](seq: NodeSeq, stack: List[ElemName] = Nil)
+                      (implicit format: XMLFormat[A]): Either[String, A] = format.reads(seq, stack)
+
+  @implicitNotFound(msg = "Cannot find CanWriteXML type class for ${A}")
+  def toXML[A](obj: A, namespace: Option[String], elementLabel: Option[String],
+      scope: NamespaceBinding, typeAttribute: Boolean = false)(implicit format: CanWriteXML[A]): NodeSeq =
+    format.writes(obj, namespace, elementLabel, scope, typeAttribute)
+
+  @implicitNotFound(msg = "Cannot find CanWriteXML type class for ${A}")
+  def toXML[A](obj: A, namespace: Option[String], elementLabel: String, scope: NamespaceBinding)
+      (implicit format: CanWriteXML[A]): NodeSeq =
+    toXML(obj, namespace, Some(elementLabel), scope, false)
+
+  @implicitNotFound(msg = "Cannot find CanWriteXML type class for ${A}")
+  def toXML[A](obj: A, elementLabel: String, scope: NamespaceBinding)(implicit format: CanWriteXML[A]): NodeSeq =
+    toXML(obj, None, Some(elementLabel), scope, false)
+
+  /** @returns - maps from prefix to namespace URI.
+   */
+  def fromScope(scope: NamespaceBinding): List[(Option[String], String)] = {
+    def doFromScope(s: NamespaceBinding): List[(Option[String], String)] = {
+      lazy val parentMap: List[(Option[String], String)] = Option[NamespaceBinding](s.parent) map { doFromScope
+        } getOrElse { Nil }
+      scalaxb.Helper.nullOrEmpty(s.uri) map { uri => (scalaxb.Helper.nullOrEmpty(s.prefix) -> uri) :: parentMap } getOrElse {parentMap}
+    }
+    doFromScope(scope).reverse
+  }
+
+  /** @param pairs - pairs of (prefix, namespace URI)
+   */
+  def toScope(pairs: (Option[String], String)*): NamespaceBinding =
+    pairs.reverse.foldLeft[NamespaceBinding](scala.xml.TopScope) { (scope, pair) =>
+      scala.xml.NamespaceBinding(pair._1.getOrElse{null}, pair._2, scope) }
+}
+
+trait XMLFormat[A] extends CanWriteXML[A] with CanReadXML[A]
+
+trait CanReadXML[A] {
+  def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, A]
+}
+
+trait CanWriteXML[A] {
+  def writes(obj: A, namespace: Option[String], elementLabel: Option[String],
+      scope: NamespaceBinding, typeAttribute: Boolean): NodeSeq
+}
+
+object XMLStandardTypes extends XMLStandardTypes {
+}
+
+trait XMLStandardTypes {
+  implicit lazy val __NodeXMLFormat: XMLFormat[Node] = new XMLFormat[Node] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Node] = seq match {
+      case node: Node => Right(node)
+      case _ => Left("scala.xml.Node is required.")
+    }
+
+    def writes(obj: Node, namespace: Option[String], elementLabel: Option[String],
+      scope: NamespaceBinding, typeAttribute: Boolean): NodeSeq = Helper.mergeNodeScope(obj, scope)
+  }
+
+  implicit lazy val __NodeSeqXMLFormat: XMLFormat[NodeSeq] = new XMLFormat[NodeSeq] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, NodeSeq] = Right(seq)
+
+    def writes(obj: NodeSeq, namespace: Option[String], elementLabel: Option[String],
+      scope: NamespaceBinding, typeAttribute: Boolean): NodeSeq = Helper.mergeNodeSeqScope(obj, scope)
+  }
+
+  implicit lazy val __ElemXMLFormat: XMLFormat[Elem] = new XMLFormat[Elem] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Elem] = seq match {
+      case elem: Elem => Right(elem)
+      case _ => Left("scala.xml.Elem is required.")
+    }
+
+    def writes(obj: Elem, namespace: Option[String], elementLabel: Option[String],
+      scope: NamespaceBinding, typeAttribute: Boolean): NodeSeq = Helper.mergeNodeScope(obj, scope)
+  }
+
+  implicit lazy val __StringXMLFormat: XMLFormat[String] = new XMLFormat[String] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, String] = Right(seq.text)
+
+    def writes(obj: String, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __IntXMLFormat: XMLFormat[Int] = new XMLFormat[Int] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Int] = try {
+      Right(seq.text.toInt) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Int, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __ByteXMLFormat: XMLFormat[Byte] = new XMLFormat[Byte] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Byte] = try {
+      Right(seq.text.toByte) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Byte, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __ShortXMLFormat: XMLFormat[Short] = new XMLFormat[Short] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Short] = try {
+      Right(seq.text.toShort) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Short, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __LongXMLFormat: XMLFormat[Long] = new XMLFormat[Long] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Long] = try {
+      Right(seq.text.toLong) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Long, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __BigDecimalXMLFormat: XMLFormat[BigDecimal] = new XMLFormat[BigDecimal] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, BigDecimal] = try {
+      Right(BigDecimal(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: BigDecimal, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __BigIntXMLFormat: XMLFormat[BigInt] = new XMLFormat[BigInt] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, BigInt] = try {
+      Right(BigInt(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: BigInt, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __FloatXMLFormat: XMLFormat[Float] = new XMLFormat[Float] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Float] = try {
+      Right(seq.text.toFloat) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Float, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __DoubleXMLFormat: XMLFormat[Double] = new XMLFormat[Double] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Double] = try {
+      Right(seq.text.toDouble) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Double, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __BooleanXMLFormat: XMLFormat[Boolean] = new XMLFormat[Boolean] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Boolean] = 
+      seq.text match {
+        case "1" | "true" => Right(true)
+        case "0" | "false" => Right(false)
+        case x => Left("Invalid boolean: "+x)
+      }
+
+    def writes(obj: Boolean, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __DurationXMLFormat: XMLFormat[javax.xml.datatype.Duration] = new XMLFormat[javax.xml.datatype.Duration] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, javax.xml.datatype.Duration] =
+      try { Right(Helper.toDuration(seq.text)) }
+      catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: javax.xml.datatype.Duration, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __CalendarXMLFormat: XMLFormat[XMLGregorianCalendar] = new XMLFormat[XMLGregorianCalendar] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, XMLGregorianCalendar] = try {
+      Right(XMLCalendar(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: XMLGregorianCalendar, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toXMLFormat, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __GregorianCalendarXMLWriter: CanWriteXML[java.util.GregorianCalendar] = new CanWriteXML[java.util.GregorianCalendar] {
+    def writes(obj: java.util.GregorianCalendar, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(Helper.toCalendar(obj).toXMLFormat, namespace, elementLabel, scope)
+  }
+
+  def qnameXMLFormat(scope: scala.xml.NamespaceBinding) = new XMLFormat[javax.xml.namespace.QName] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, javax.xml.namespace.QName] =
+      seq match {
+        case node: scala.xml.Node =>
+          val (namespace, localPart) = Helper.splitQName(node.text, scope)
+          Right(new QName(namespace orNull, localPart))
+        case _ => Left("scala.xml.Node is required")
+      }
+
+    def writes(obj: javax.xml.namespace.QName, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __QNameXMLFormat: XMLFormat[javax.xml.namespace.QName] = new XMLFormat[javax.xml.namespace.QName] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, javax.xml.namespace.QName] =
+      seq match {
+        case node: scala.xml.Node => qnameXMLFormat(node.scope).reads(node, stack)
+        case _ => Left("scala.xml.Node is required")
+      }
+
+    def writes(obj: javax.xml.namespace.QName, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __Base64BinaryXMLFormat: XMLFormat[Base64Binary] = new XMLFormat[Base64Binary] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Base64Binary] = try {
+      Right(Base64Binary(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: Base64Binary, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __HexBinaryXMLFormat: XMLFormat[HexBinary] = new XMLFormat[HexBinary] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, HexBinary] = try {
+      Right(HexBinary(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: HexBinary, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit lazy val __URIXMLFormat: XMLFormat[java.net.URI] = new XMLFormat[java.net.URI] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, java.net.URI] = try {
+      Right(Helper.toURI(seq.text)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: java.net.URI, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML(obj.toString, namespace, elementLabel, scope)
+  }
+
+  implicit def seqXMLFormat[A: XMLFormat]: XMLFormat[Seq[A]] = new XMLFormat[Seq[A]] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, Seq[A]] =
+    seq match {
+      case node: scala.xml.Node =>
+        try {
+          val xs = Helper.splitBySpace(node.text).toSeq
+          Right(xs map { x => fromXML[A](scala.xml.Elem(node.prefix, node.label, scala.xml.Null, node.scope, scala.xml.Text(x)), stack) })
+        } catch { case e: Exception => Left(e.toString) }
+      case _ => Left("Node expected: " + seq.toString)
+    }
+
+    def writes(obj: Seq[A], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.stringToXML((obj map { x => scalaxb.toXML(x, namespace, elementLabel, scope, typeAttribute).text }).mkString(" "),
+        namespace, elementLabel, scope)
+  }
+
+  implicit def dataRecordFormat[A: XMLFormat]: XMLFormat[DataRecord[A]] = new XMLFormat[DataRecord[A]] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, DataRecord[A]] = seq match {
+      case node: Node =>
+        try {
+          Right(DataRecord(Some(node.namespace), Some(node.label), scalaxb.fromXML[A](node)))
+        } catch { case e: Exception => Left(e.toString) }
+      case _ => Left("scala.xml.Node is required.")
+    }
+
+    def writes(obj: DataRecord[A], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      DataRecord.toXML(obj, namespace, elementLabel, scope, typeAttribute)
+  }
+
+  implicit def dataRecordXMLWriter[A]: CanWriteXML[DataRecord[A]] = new CanWriteXML[DataRecord[A]] {
+    def writes(obj: DataRecord[A], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      DataRecord.toXML(obj, namespace, elementLabel, scope, typeAttribute)
+  }
+
+  implicit def someXMLWriter[A: CanWriteXML]: CanWriteXML[Some[A]] = new CanWriteXML[Some[A]] {
+    def writes(obj: Some[A], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      scalaxb.toXML[A](obj.get, namespace, elementLabel, scope, typeAttribute)
+  }
+
+  implicit def optionXMLWriter[A: CanWriteXML]: CanWriteXML[Option[A]] = new CanWriteXML[Option[A]] {
+    def writes(obj: Option[A], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq = obj match {
+      case Some(x) => scalaxb.toXML[A](x, namespace, elementLabel, scope, typeAttribute)
+      case None    => Helper.nilElem(namespace, elementLabel.get, scope)
+    }
+  }
+
+  implicit lazy val __NoneXMLWriter: CanWriteXML[None.type] = new  CanWriteXML[None.type] {
+    def writes(obj: None.type, namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      Helper.nilElem(namespace, elementLabel.get, scope)
+  }
+
+  implicit lazy val __DataRecordAnyXMLFormat: XMLFormat[DataRecord[Any]] = new XMLFormat[DataRecord[Any]] {
+    def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, DataRecord[Any]] = try {
+      Right(DataRecord.fromAny(seq)) } catch { case e: Exception => Left(e.toString) }
+
+    def writes(obj: DataRecord[Any], namespace: Option[String], elementLabel: Option[String],
+        scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+      DataRecord.toXML(obj, namespace, elementLabel, scope, typeAttribute)
+  }
+
+  implicit lazy val __DataRecordOptionAnyXMLFormat: XMLFormat[DataRecord[Option[Any]]] =
+    new XMLFormat[DataRecord[Option[Any]]] {
+      def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, DataRecord[Option[Any]]] = try {
+        Right(DataRecord.fromNillableAny(seq)) } catch { case e: Exception => Left(e.toString) }
+
+      def writes(obj: DataRecord[Option[Any]], namespace: Option[String], elementLabel: Option[String],
+          scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+        DataRecord.toXML(obj, namespace, elementLabel, scope, typeAttribute)
+    }
+
+  implicit lazy val __DataRecordMapWriter: CanWriteXML[Map[String, scalaxb.DataRecord[Any]]] =
+    new CanWriteXML[Map[String, scalaxb.DataRecord[Any]]] {
+      def writes(obj: Map[String, scalaxb.DataRecord[Any]], namespace: Option[String], elementLabel: Option[String],
+          scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq =
+        obj.valuesIterator.toList flatMap { x =>
+          scalaxb.toXML[DataRecord[Any]](x, x.namespace, x.key, scope, typeAttribute)
+        }
+    }
+}
+
+trait DataRecord[+A] {
+  val namespace: Option[String]
+  val key: Option[String]
+  val value: A
+
+  def as[B] = value.asInstanceOf[B]
+
+  override def toString: String = {
+    "DataRecord(" +
+    ((namespace, key, value) match {
+      case (None, Some(k), _) => k + "," + value.toString
+      case (Some(n), Some(k), _) => "{" + n + "}" + k + "," + value.toString
+      case _ => value.toString
+    }) + ")"
+  }
+}
+
+object DataRecord extends XMLStandardTypes {
+  private case class DataWriter[+A](
+    namespace: Option[String],
+    key: Option[String],
+    xstypeNamespace: Option[String],
+    xstypeName: Option[String],
+    value: A,
+    writer: CanWriteXML[_]) extends DataRecord[A] {
+    override def equals(o: Any): Boolean =
+      o match {
+        case that: DataWriter[_] =>
+          namespace == that.namespace &&
+          key == that.key &&
+          value == that.value
+        case _ => false
+      }
+
+    override def hashCode: Int = {
+      var result = 17
+      result = result + 31 * namespace.hashCode
+      result = result + 31 * key.hashCode
+      result = result + 31 * value.hashCode
+      result
+    }
+  }
+  import Helper._
+
+  // this is for nil element.
+  def apply(namespace: Option[String], key: Option[String], value: None.type): DataRecord[Option[Nothing]] =
+    DataWriter(namespace, key, None, None, value, __NoneXMLWriter)
+
+  // this is for choice option: DataRecord(x.namespace, Some(x.name), fromXML[Address](x))
+  def apply[A:CanWriteXML](namespace: Option[String], key: Option[String], value: A): DataRecord[A] =
+    DataWriter(namespace, key, None, None, value, implicitly[CanWriteXML[A]])
+
+  def apply[A:CanWriteXML](node: Node, value: A): DataRecord[A] = node match {
+    case elem: Elem =>
+      val ns = scalaxb.Helper.nullOrEmpty(elem.scope.getURI(elem.prefix))
+      val key = Some(elem.label)
+      DataRecord(ns, key, value)
+    case _ => DataRecord(value)
+  }
+
+  // this is for long attributes
+  def apply[A:CanWriteXML](x: Node, parent: Node, value: A): DataRecord[A] = x match {
+    case _ => DataRecord(value)
+  }
+
+  def apply[A:CanWriteXML](value: A): DataRecord[A] =
+    apply(None, None, value)
+
+  def apply[A:CanWriteXML](namespace: Option[String], key: Option[String],
+      xstypeNamespace: Option[String], xstypeName: Option[String], value: A): DataRecord[A] =
+    DataWriter(namespace, key, xstypeNamespace, xstypeName, value, implicitly[CanWriteXML[A]])
+
+  // this is for any.
+  def apply(elemName: ElemName): DataRecord[Any] = fromAny(elemName.node)
+
+  def fromAny(seq: NodeSeq): DataRecord[Any] = {
+    seq match {
+      case elem: Elem => fromAny(elem)
+      case _ => DataRecord(None, None, None, None, seq.text)
+    }
+  }
+
+  def fromAny(elem: Elem): DataRecord[Any] = {
+    val ns = scalaxb.Helper.nullOrEmpty(elem.scope.getURI(elem.prefix))
+    val key = Some(elem.label)
+    val XS = Some(XML_SCHEMA_URI)
+
+    instanceType(elem) match {
+      case (XS, xstype)   =>
+        xstype match {
+          case Some("int")                => DataRecord(ns, key, XS, xstype, fromXML[Int](elem, Nil))
+          case Some("byte")               => DataRecord(ns, key, XS, xstype, fromXML[Byte](elem, Nil))
+          case Some("short")              => DataRecord(ns, key, XS, xstype, fromXML[Short](elem, Nil))
+          case Some("long")               => DataRecord(ns, key, XS, xstype, fromXML[Long](elem, Nil))
+          case Some("float")              => DataRecord(ns, key, XS, xstype, fromXML[Float](elem, Nil))
+          case Some("double")             => DataRecord(ns, key, XS, xstype, fromXML[Double](elem, Nil))
+          case Some("integer")            => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("nonPositiveInteger") => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("negativeInteger")    => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("nonNegativeInteger") => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("positiveInteger")    => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("unsignedLong")       => DataRecord(ns, key, XS, xstype, fromXML[BigInt](elem, Nil))
+          case Some("unsignedInt")        => DataRecord(ns, key, XS, xstype, fromXML[Long](elem, Nil))
+          case Some("unsignedShort")      => DataRecord(ns, key, XS, xstype, fromXML[Int](elem, Nil))
+          case Some("unsignedByte")       => DataRecord(ns, key, XS, xstype, fromXML[Int](elem, Nil))
+          case Some("decimal")            => DataRecord(ns, key, XS, xstype, fromXML[BigDecimal](elem, Nil))
+          case Some("boolean")            => DataRecord(ns, key, XS, xstype, fromXML[Boolean](elem, Nil))
+          case Some("string")             => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("normalizedString")   => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("token")              => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("language")           => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("Name")               => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("NCName")             => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("NMTOKEN")            => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("NMTOKENS")           => DataRecord(ns, key, XS, xstype, fromXML[Seq[String]](elem, Nil))
+          case Some("ID")                 => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("IDREF")              => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("IDREFS")             => DataRecord(ns, key, XS, xstype, fromXML[Seq[String]](elem, Nil))
+          case Some("ENTITY")             => DataRecord(ns, key, XS, xstype, fromXML[String](elem, Nil))
+          case Some("ENTITIES")           => DataRecord(ns, key, XS, xstype, fromXML[Seq[String]](elem, Nil))
+          case Some("hexBinary")          => DataRecord(ns, key, XS, xstype, fromXML[HexBinary](elem, Nil))
+          case Some("base64Binary")       => DataRecord(ns, key, XS, xstype, fromXML[Base64Binary](elem, Nil))
+          case Some("anyURI")             => DataRecord(ns, key, XS, xstype, fromXML[java.net.URI](elem, Nil))
+          case Some("QName")              => DataRecord(ns, key, XS, xstype, fromXML[javax.xml.namespace.QName](elem, Nil))
+          case Some("NOTATION")           => DataRecord(ns, key, XS, xstype, fromXML[javax.xml.namespace.QName](elem, Nil))
+          case Some("duration")           => DataRecord(ns, key, XS, xstype, fromXML[javax.xml.datatype.Duration](elem, Nil))
+          case Some("dateTime")           => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("time")               => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("gYearMonth")         => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("gYear")              => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("gMonthDay")          => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("gDay")               => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+          case Some("gMonth")             => DataRecord(ns, key, XS, xstype, fromXML[XMLGregorianCalendar](elem, Nil))
+
+          case _          => DataRecord(ns, key, XS, xstype, elem)
+        }
+      case _ =>
+        val (xsns, xstype) = instanceType(elem)
+        DataRecord(ns, key, xsns, xstype, elem)
+    }
+  }
+
+  // this is for any.
+  def fromNillableAny(seq: NodeSeq): DataRecord[Option[Any]] = {
+    seq match {
+      case elem: Elem => fromNillableAny(elem)
+      case _ => DataRecord(None, None, None, None, Some(seq.text))
+    }
+  }
+
+  // this is for any.
+  def fromNillableAny(elem: Elem): DataRecord[Option[Any]] = {
+    val ns = scalaxb.Helper.nullOrEmpty(elem.scope.getURI(elem.prefix))
+    val key = Some(elem.label)
+    val XS = Some(XML_SCHEMA_URI)
+
+    if (isNil(elem)) DataRecord(ns, key, None)
+    else instanceType(elem) match {
+      case (XS, xstype)   =>
+        xstype match {
+          case Some("int")                => DataRecord(ns, key, XS, xstype, Some(fromXML[Int](elem, Nil)))
+          case Some("byte")               => DataRecord(ns, key, XS, xstype, Some(fromXML[Byte](elem, Nil)))
+          case Some("short")              => DataRecord(ns, key, XS, xstype, Some(fromXML[Short](elem, Nil)))
+          case Some("long")               => DataRecord(ns, key, XS, xstype, Some(fromXML[Long](elem, Nil)))
+          case Some("float")              => DataRecord(ns, key, XS, xstype, Some(fromXML[Float](elem, Nil)))
+          case Some("double")             => DataRecord(ns, key, XS, xstype, Some(fromXML[Double](elem, Nil)))
+          case Some("integer")            => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("nonPositiveInteger") => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("negativeInteger")    => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("nonNegativeInteger") => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("positiveInteger")    => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("unsignedLong")       => DataRecord(ns, key, XS, xstype, Some(fromXML[BigInt](elem, Nil)))
+          case Some("unsignedInt")        => DataRecord(ns, key, XS, xstype, Some(fromXML[Long](elem, Nil)))
+          case Some("unsignedShort")      => DataRecord(ns, key, XS, xstype, Some(fromXML[Int](elem, Nil)))
+          case Some("unsignedByte")       => DataRecord(ns, key, XS, xstype, Some(fromXML[Int](elem, Nil)))
+          case Some("decimal")            => DataRecord(ns, key, XS, xstype, Some(fromXML[BigDecimal](elem, Nil)))
+          case Some("boolean")            => DataRecord(ns, key, XS, xstype, Some(fromXML[Boolean](elem, Nil)))
+          case Some("string")             => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("normalizedString")   => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("token")              => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("language")           => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("Name")               => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("NCName")             => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("NMTOKEN")            => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("NMTOKENS")           => DataRecord(ns, key, XS, xstype, Some(fromXML[Seq[String]](elem, Nil)))
+          case Some("ID")                 => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("IDREF")              => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("IDREFS")             => DataRecord(ns, key, XS, xstype, Some(fromXML[Seq[String]](elem, Nil)))
+          case Some("ENTITY")             => DataRecord(ns, key, XS, xstype, Some(fromXML[String](elem, Nil)))
+          case Some("ENTITIES")           => DataRecord(ns, key, XS, xstype, Some(fromXML[Seq[String]](elem, Nil)))
+          case Some("hexBinary")          => DataRecord(ns, key, XS, xstype, Some(fromXML[HexBinary](elem, Nil)))
+          case Some("base64Binary")       => DataRecord(ns, key, XS, xstype, Some(fromXML[Base64Binary](elem, Nil)))
+          case Some("anyURI")             => DataRecord(ns, key, XS, xstype, Some(fromXML[java.net.URI](elem, Nil)))
+          case Some("QName")              => DataRecord(ns, key, XS, xstype, Some(fromXML[javax.xml.namespace.QName](elem, Nil)))
+          case Some("NOTATION")           => DataRecord(ns, key, XS, xstype, Some(fromXML[javax.xml.namespace.QName](elem, Nil)))
+          case Some("duration")           => DataRecord(ns, key, XS, xstype, Some(fromXML[javax.xml.datatype.Duration](elem, Nil)))
+          case Some("dateTime")           => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("time")               => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("gYearMonth")         => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("gYear")              => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("gMonthDay")          => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("gDay")               => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+          case Some("gMonth")             => DataRecord(ns, key, XS, xstype, Some(fromXML[XMLGregorianCalendar](elem, Nil)))
+
+          case _          => DataRecord(ns, key, XS, xstype, Some(elem))
+        }
+      case _ =>
+        val (xsns, xstype) = instanceType(elem)
+        DataRecord(ns, key, xsns, xstype, Some(elem))
+    }
+  }
+
+  def unapply[A](record: DataRecord[A]): Option[(Option[String], Option[String], A)] =
+    Some(record.namespace, record.key, record.value)
+
+  def toXML[A](obj: DataRecord[A], namespace: Option[String], elementLabel: Option[String],
+      scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq = obj match {
+    case w: DataWriter[_] =>
+      obj.value match {
+        case seq: NodeSeq =>
+          w.writer.asInstanceOf[CanWriteXML[A]].writes(obj.value, namespace, elementLabel, scope, typeAttribute)
+        case _ =>
+          w.writer.asInstanceOf[CanWriteXML[A]].writes(obj.value, namespace, elementLabel, scope, false) match {
+            case elem: Elem if (w.xstypeName.isDefined && scope.getPrefix(XSI_URL) != null) =>
+              elem % scala.xml.Attribute(scope.getPrefix(Helper.XSI_URL), "type",
+                Helper.prefixedName(w.xstypeNamespace, w.xstypeName.get, scope), scala.xml.Null)
+            case x => x
+          }
+      }
+    case _ => sys.error("unknown DataRecord.")
+  }
+}
+
+case class ElemName(namespace: Option[String], name: String) {
+  var node: scala.xml.Node = _
+  def text = node.text
+  def nil = Helper.isNil(node)
+  def nilOption: Option[ElemName] = if (nil) None else Some(this)
+  def splitBySpace = Helper.splitBySpace(text)
+  override def toString = namespace match {
+    case Some(x) => "{%s}%s".format(x, name)
+    case _ => name
+  }
+}
+
+object ElemName {
+  implicit def apply(node: scala.xml.Node): ElemName = node match {
+    case x: scala.xml.Elem =>
+      val elemName = ElemName(scalaxb.Helper.nullOrEmpty(x.scope.getURI(x.prefix)), x.label)
+      elemName.node = x
+      elemName
+    case _ =>
+      val elemName = ElemName(None, "")
+      elemName.node = node
+      elemName
+  }
+}
+
+trait AnyElemNameParser extends scala.util.parsing.combinator.Parsers {
+  type Elem = ElemName
+
+  // we need this so treat ElemName as NodeSeq for fromXML etc.
+  implicit def toNodeSeq(elem: Elem): scala.xml.NodeSeq = elem.node
+
+  def any(f: ElemName => Boolean): Parser[ElemName] =
+    accept("any", { case x: ElemName if x.name != "" && f(x) => x })
+
+  def optTextRecord(implicit format: XMLFormat[String]): Parser[Option[DataRecord[Any]]] =
+    opt(text ^^ (x => DataRecord(x.node.text)(format)))
+
+  def text: Parser[ElemName] =
+    accept("text", { case x: ElemName if x.name == "" => x })
+}
+
+trait CanWriteChildNodes[A] extends CanWriteXML[A] {
+  def targetNamespace: Option[String]
+  def typeName: Option[String] = None
+  def writesAttribute(obj: A, scope: scala.xml.NamespaceBinding): scala.xml.MetaData = scala.xml.Null
+  def writesChildNodes(obj: A, scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node]
+
+  def writes(obj: A, namespace: Option[String], elementLabel: Option[String],
+      scope: scala.xml.NamespaceBinding, typeAttribute: Boolean): scala.xml.NodeSeq = {
+    val elem =  scala.xml.Elem(Helper.getPrefix(namespace, scope).orNull,
+      elementLabel getOrElse { sys.error("missing element label.") },
+      writesAttribute(obj, scope),
+      scope,
+      writesChildNodes(obj, scope): _*)
+    if (typeAttribute && typeName.isDefined && scope.getPrefix(Helper.XSI_URL) != null)
+      elem % scala.xml.Attribute(scope.getPrefix(Helper.XSI_URL), "type",
+        Helper.prefixedName(targetNamespace, typeName.get, scope), scala.xml.Null)
+    else elem
+  }
+}
+
+trait AttributeGroupFormat[A] extends scalaxb.XMLFormat[A] {
+  def writes(__obj: A, __namespace: Option[String], __elementLabel: Option[String],
+    __scope: scala.xml.NamespaceBinding, __typeAttribute: Boolean): scala.xml.NodeSeq = sys.error("don't call me.")
+
+  def toAttribute(__obj: A, __attr: scala.xml.MetaData, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData
+}
+
+trait ElemNameParser[A] extends AnyElemNameParser with XMLFormat[A] with CanWriteChildNodes[A] {
+  def reads(seq: scala.xml.NodeSeq, stack: List[ElemName]): Either[String, A] = seq match {
+    case node: scala.xml.Node =>
+      parse(parser(node, stack), node.child) match {
+        case x: Success[_] => Right(x.get)
+        case x: Failure => Left(parserErrorMsg(x.msg, x.next, ElemName(node) :: stack))
+        case x: Error => Left(parserErrorMsg(x.msg, node))
+      }
+    case _ => Left("seq must be scala.xml.Node")
+  }
+
+  private def parserErrorMsg(msg: String, next: scala.util.parsing.input.Reader[Elem], stack: List[ElemName]): String =
+    if (msg contains "paser error ") msg
+    else "parser error \"" + msg + "\" while parsing " + stack.reverse.mkString("/", "/", "/") + next.pos.longString
+
+  private def parserErrorMsg(msg: String, node: scala.xml.Node): String =
+    if (msg contains "paser error ") msg
+    else "parser error \"" + msg + "\" while parsing " + node.toString
+
+  def parser(node: scala.xml.Node, stack: List[ElemName]): Parser[A]
+  def isMixed: Boolean = false
+
+  def parse[A](p: Parser[A], in: Seq[scala.xml.Node]): ParseResult[A] =
+    p(new ElemNameSeqReader(elementNames(in)))
+
+  def elementNames(in: Seq[scala.xml.Node]): Seq[ElemName] =
+    if (isMixed) in map { x => ElemName(x) }
+    else in collect { case x: scala.xml.Elem => ElemName(x) }
+}
+
+class ElemNameSeqReader(seq: Seq[ElemName],
+    override val offset: Int) extends scala.util.parsing.input.Reader[ElemName] {
+  import scala.util.parsing.input._
+
+  def this(seq: Seq[ElemName]) = this(seq, 0)
+
+  override def first: ElemName  =
+    if (seq.isDefinedAt(offset)) seq(offset)
+    else null
+
+  def rest: ElemNameSeqReader =
+    if (seq.isDefinedAt(offset)) new ElemNameSeqReader(seq, offset + 1)
+    else this
+
+  def pos: Position = new ElemNameSeqPosition(seq, offset)
+
+  def atEnd = !seq.isDefinedAt(offset)
+
+  override def drop(n: Int): ElemNameSeqReader =
+    new ElemNameSeqReader(seq, offset + n)
+}
+
+class ElemNameSeqPosition(val source: Seq[ElemName], val offset: Int) extends
+    scala.util.parsing.input.Position {
+  protected def lineContents =
+    source.mkString
+
+  override def line = 1
+  override def column = offset + 1
+}
+
+class HexBinary(_vector: Vector[Byte]) extends scala.collection.IndexedSeq[Byte] {
+  val vector = _vector
+  def length = vector.length
+  def apply(idx: Int): Byte = vector(idx)
+  override def toString: String = DatatypeConverter.printHexBinary(vector.toArray)
+}
+
+object HexBinary {
+  def apply(xs: Byte*): HexBinary = {
+    import scala.collection.breakOut
+    val vector: Vector[Byte] = (xs.toIndexedSeq map {x: Byte => x})(breakOut)
+    new HexBinary(vector)
+  }
+
+  def apply(value: String): HexBinary = {
+    val array = DatatypeConverter.parseHexBinary(value)
+    apply(array: _*)
+  }
+
+  def unapplySeq[Byte](x: HexBinary) = Some(x.vector)
+}
+
+class Base64Binary(_vector: Vector[Byte]) extends scala.collection.IndexedSeq[Byte] {
+  val vector = _vector
+  def length = vector.length
+  def apply(idx: Int): Byte = vector(idx)
+  override def toString: String = DatatypeConverter.printBase64Binary(vector.toArray)
+}
+
+object Base64Binary {
+  def apply(xs: Byte*): Base64Binary = {
+    import scala.collection.breakOut
+    val vector: Vector[Byte] = (xs.toIndexedSeq map {x: Byte => x})(breakOut)
+    new Base64Binary(vector)
+  }
+
+  def apply(value: String): Base64Binary = {
+    val array = DatatypeConverter.parseBase64Binary(value)
+    apply(array: _*)
+  }
+
+  def unapplySeq[Byte](x: Base64Binary) = Some(x.vector)
+}
+
+object XMLCalendar {
+  def apply(value: String): XMLGregorianCalendar = Helper.toCalendar(value)
+  def unapply(value: XMLGregorianCalendar): Option[String] = Some(value.toXMLFormat)
+}
+
+object Helper {
+  val XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema"
+  val XSI_URL = "http://www.w3.org/2001/XMLSchema-instance"
+  val XSI_PREFIX = "xsi"
+
+  def toString(value: QName, scope: NamespaceBinding): String =
+    Option[String](scope.getPrefix(value.getNamespaceURI)) map {
+      "%s:%s" format (_, value.getLocalPart)} getOrElse {value.getLocalPart}
+
+  def toCalendar(value: String): XMLGregorianCalendar = {
+    import javax.xml.datatype._
+    val typeFactory = javax.xml.datatype.DatatypeFactory.newInstance()
+    typeFactory.newXMLGregorianCalendar(value)
+  }
+
+  def toCalendar(value: java.util.GregorianCalendar): XMLGregorianCalendar = {
+    import javax.xml.datatype._
+    import java.util.{GregorianCalendar, Calendar => JCalendar}
+
+    val typeFactory = javax.xml.datatype.DatatypeFactory.newInstance()
+    val xmlGregorian = typeFactory.newXMLGregorianCalendar()
+    if (value.getTimeZone != null) {
+      xmlGregorian.setTimezone(value.getTimeZone.getRawOffset / 60000)
+    }
+
+    if (value.isSet(JCalendar.YEAR)) xmlGregorian.setYear(if (value.get(JCalendar.ERA) == GregorianCalendar.AD) value.get(JCalendar.YEAR) else -value.get(JCalendar.YEAR))
+    if (value.isSet(JCalendar.MONTH)) xmlGregorian.setMonth(value.get(JCalendar.MONTH) - JCalendar.JANUARY + DatatypeConstants.JANUARY)
+    if (value.isSet(JCalendar.DAY_OF_MONTH)) xmlGregorian.setDay(value.get(JCalendar.DAY_OF_MONTH))
+    if (value.isSet(JCalendar.HOUR_OF_DAY)) xmlGregorian.setHour(value.get(JCalendar.HOUR_OF_DAY))
+    if (value.isSet(JCalendar.MINUTE)) xmlGregorian.setMinute(value.get(JCalendar.MINUTE))
+    if (value.isSet(JCalendar.SECOND)) xmlGregorian.setSecond(value.get(JCalendar.SECOND))
+    if (value.isSet(JCalendar.MILLISECOND) && value.get(JCalendar.MILLISECOND) > 0) xmlGregorian.setFractionalSecond(new java.math.BigDecimal(value.get(JCalendar.MILLISECOND)))
+
+    xmlGregorian
+  }
+
+  def toDuration(value: String) = {
+    val typeFactory = javax.xml.datatype.DatatypeFactory.newInstance()
+    typeFactory.newDuration(value)
+  }
+
+  def toURI(value: String) =
+    java.net.URI.create(value.trim)
+
+  def isNil(node: scala.xml.Node) =
+    (node \ ("@{" + XSI_URL + "}nil")).headOption map { _.text == "true" } getOrElse {
+      false
+    }
+
+  def nilElem(namespace: Option[String], elementLabel: String,
+      scope: scala.xml.NamespaceBinding) =
+    scala.xml.Elem(getPrefix(namespace, scope).orNull, elementLabel,
+      scala.xml.Attribute(scope.getPrefix(XSI_URL), "nil", "true", scala.xml.Null),
+      scope)
+
+  def splitBySpace(text: String) = text.split(' ').filter("" !=)
+
+  def instanceType(node: scala.xml.Node): (Option[String], Option[String]) = {
+    val typeName = (node \ ("@{" + XSI_URL + "}type")).text
+    val prefix = if (typeName.contains(':')) Some(typeName.dropRight(typeName.length - typeName.indexOf(':')))
+      else None
+    val namespace = scalaxb.Helper.nullOrEmpty(node.scope.getURI(prefix.orNull))
+    val value = if (typeName.contains(':')) typeName.drop(typeName.indexOf(':') + 1)
+      else typeName
+    (namespace, if (value == "") None else Some(value))
+  }
+
+  def splitQName(value: String, scope: scala.xml.NamespaceBinding): (Option[String], String) =
+    if (value startsWith "{") {
+      val qname = javax.xml.namespace.QName.valueOf(value)
+      (nullOrEmpty(qname.getNamespaceURI), qname.getLocalPart)
+    }
+    else if (value contains ':') {
+      val prefix = value.dropRight(value.length - value.indexOf(':'))
+      val localPart = value.drop(value.indexOf(':') + 1)
+      (nullOrEmpty(scope.getURI(prefix)), localPart)
+    }
+    else (nullOrEmpty(scope.getURI(null)), value)
+
+  def nullOrEmpty(value: String): Option[String] =
+    value match {
+      case null | "" => None
+      case x => Some(x)
+    }
+
+  def getPrefix(namespace: Option[String], scope: scala.xml.NamespaceBinding) =
+    if (nullOrEmpty(scope.getURI(null)) == namespace) None
+    else nullOrEmpty(scope.getPrefix(namespace.orNull))
+
+  def prefixedName(namespace: Option[String], name: String, scope: scala.xml.NamespaceBinding) =
+    getPrefix(namespace, scope) map { """%s:%s""" format(_, name)
+    } getOrElse {name}
+
+  def stringToXML(obj: String, namespace: Option[String], elementLabel: Option[String],
+       scope: scala.xml.NamespaceBinding): scala.xml.NodeSeq = {
+    elementLabel map { label =>
+      scala.xml.Elem(getPrefix(namespace, scope).orNull, label,
+        scala.xml.Null,
+        scope, scala.xml.Text(obj.toString))
+    } getOrElse { scala.xml.Text(obj) }
+  }
+
+  // assume outer scope
+  def mergeNodeSeqScope(nodeseq: NodeSeq, outer: NamespaceBinding): NodeSeq =
+    nodeseq.toSeq flatMap { mergeNodeScope(_, outer) }
+
+  // assume outer scope
+  def mergeNodeScope(node: Node, outer: NamespaceBinding): Node =
+    node match {
+      case elem: Elem =>
+        withInnerScope(elem.scope, outer) { (innerScope, mapping) =>
+          val newPrefix: String = mapping.get(scalaxb.Helper.nullOrEmpty(elem.prefix)) map {_.orNull} getOrElse {elem.prefix}
+          val newChild = mergeNodeSeqScope(mergeNodeSeqScope(elem.child, outer), innerScope)
+          elem.copy(scope = innerScope, prefix = newPrefix, child = newChild)
+        }
+      case _ => node
+    }
+
+  def withInnerScope[A](scope: NamespaceBinding, outer: NamespaceBinding)
+                    (f: (NamespaceBinding, Map[Option[String], Option[String]]) => A): A = {
+    val outerList = fromScope(outer)
+    def renamePrefix(prefix: Option[String],  n: Int): Option[String] =
+      if (outerList exists { case (p, n) => p == Some((prefix getOrElse {"ns"}) + n.toString)}) renamePrefix(prefix, n + 1)
+      else Some((prefix getOrElse {"ns"}) + n.toString)
+
+    val xs: List[((Option[String], String), (Option[String], Option[String]))] = fromScope(scope) flatMap {
+      case (prefix, ns) if outerList contains (prefix -> ns) => None
+      case (prefix, ns) if outerList exists { case (p, n) => p == prefix && p.isDefined } =>
+        val renamed = renamePrefix(prefix, 2)
+        Some((renamed -> ns, prefix -> renamed))
+      case (prefix, ns) => Some((prefix -> ns, prefix -> prefix))
+    }
+
+    f(toScope(xs map {_._1}: _*), Map(xs map {_._2}: _*))
+  }
+
+  def resolveSoap11Refs(node: Node): Node = {
+    import scala.xml.transform._
+
+    def lookupRef(id: String): Seq[Node] =
+      node.child flatMap {
+        case elem: Elem if (elem \ "@id").text == id =>
+          if ((elem \ "@{http://schemas.xmlsoap.org/soap/encoding/}root").text == "1") elem
+          else elem.child.toSeq
+        case _ => Nil
+      }
+    val rule = new RewriteRule {
+      override def transform(n: Node): Seq[Node] = n match {
+        case x@Elem(prefix, label, attr, scope, _*) if attr exists(p => p.key == "href") =>
+          Elem(prefix, label, attr remove("href"), scope, lookupRef((x \ "@href").text.tail): _*)
+        case x@Elem(prefix, label, attr, scope, _*) if attr exists(p => p.key == "id") =>
+          Nil
+        case other => other
+      }
+    }
+    val rt = new RuleTransformer(rule)
+    var retval: Node = node
+    while (retval != rt(retval)) {
+      retval = rt(retval)
+    } // while
+    retval
+  }
+}
+
+class ParserFailure(message: String) extends RuntimeException(message)

src/main/scala/soap11.scala

+package scalaxb
+
+case class Soap11Fault[+A](original: Any, detail: Option[A], headers: scala.xml.NodeSeq) {
+  def asFault[B: scalaxb.XMLFormat] = Soap11Fault(original, detail map {
+    case x: soapenvelope11.Detail => x.any.head.value match {
+      case node: scala.xml.Node => scalaxb.fromXML[B](node)
+      case _ => sys.error("unsupported fault: " + toString)
+    }
+    case _ => sys.error("unsupported fault: " + toString)
+  }, headers)
+}
+
+trait Soap11Clients { this: HttpClients =>
+  lazy val soapClient: Soap11Client = new Soap11Client {}
+  def baseAddress: java.net.URI
+
+  trait Soap11Client {
+    import soapenvelope11._
+    // TODO: allow this to be supplied
+    import scala.concurrent.ExecutionContext.Implicits.global
+    val SOAP_ENVELOPE11_URI = "http://schemas.xmlsoap.org/soap/envelope/"
+
+    def soapRequest(in: Option[Envelope], scope: scala.xml.NamespaceBinding,
+                    address: java.net.URI, webMethod: String, action: Option[java.net.URI]): scala.concurrent.Future[Envelope] = {
+      val merged = scalaxb.toScope(((Some("soap11") -> SOAP_ENVELOPE11_URI) ::
+        scalaxb.fromScope(scope)).distinct: _*)
+      val r = in map  { scalaxb.toXML(_, Some(SOAP_ENVELOPE11_URI), Some("Envelope"), merged) match {
+        case elem: scala.xml.Elem => elem
+        case x => sys.error("unexpected non-elem: " + x.toString)
+      }}
+      val headers = scala.collection.mutable.Map[String, String]("Content-Type" -> "text/xml; charset=utf-8") ++
+        (action map { x => "SOAPAction" -> """"%s"""".format(x)})
+
+      for(s <- httpClient.request(r map {_.toString} getOrElse {""}, address, headers.toMap))
+        yield { 
+          try {
+            val response = scala.xml.XML.loadString(s)
+            scalaxb.fromXML[Envelope](response)
+          }
+          catch {
+            case e: Exception => sys.error(e.toString + ": " + s)
+          }
+        }
+    }
+
+    def requestResponse(body: scala.xml.NodeSeq, headers: scala.xml.NodeSeq, scope: scala.xml.NamespaceBinding,
+                        address: java.net.URI, webMethod: String, action: Option[java.net.URI]):
+        scala.concurrent.Future[Either[Soap11Fault[Detail], (scala.xml.NodeSeq, scala.xml.NodeSeq)]] = {
+      val bodyRecords = body.toSeq map { DataRecord(None, None, _) }
+      val headerOption = headers.toSeq.headOption map { _ =>
+        Header(headers.toSeq map {DataRecord(None, None, _)}, Map())
+      }
+      val envelope = Envelope(headerOption, Body(bodyRecords, Map()), Nil, Map())
+      for(r <- soapRequest(Some(envelope), scope, address, webMethod, action))
+        yield { buildResponse(r) }
+    }
+
+    def soapResponse(location: Option[String], params: Map[String, Any],
+                     address: java.net.URI, webMethod: String, action: Option[java.net.URI]):
+        scala.concurrent.Future[Either[Soap11Fault[Detail], (scala.xml.NodeSeq, scala.xml.NodeSeq)]] = {
+      for(r <- soapRequest(None, scala.xml.TopScope, address, webMethod, action))
+        yield { buildResponse(r) }
+    }
+
+    def buildResponse(soapResponse: Envelope):
+        Either[Soap11Fault[Detail], (scala.xml.NodeSeq, scala.xml.NodeSeq)] = {
+      val header: scala.xml.NodeSeq =
+        soapResponse.Header.toSeq flatMap { header =>
+          header.any collect {
+            case DataRecord(_, _, x: scala.xml.Node) => x
+          }
+        }
+      soapResponse.Body.any.headOption match {
+        case Some(DataRecord(_, _, x: scala.xml.Elem)) if (x.label == "Fault") &&
+            (x.scope.getURI(x.prefix) == SOAP_ENVELOPE11_URI) =>
+          val fault = scalaxb.fromXML[soapenvelope11.Fault](x)
+          Left(Soap11Fault(fault, fault.detail, header))
+        case _ =>
+          Right(header, soapResponse.Body.any collect {
+            case DataRecord(_, _, x: scala.xml.Node) => x
+          })
+      }
+    }
+  }
+}

src/main/scala/soapenvelope11.scala

+// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
+package soapenvelope11
+
+
+case class Envelope(Header: Option[soapenvelope11.Header] = None,
+  Body: soapenvelope11.Body,
+  any: Seq[scalaxb.DataRecord[Any]] = Nil,
+  attributes: Map[String, scalaxb.DataRecord[Any]])
+
+
+case class Header(any: Seq[scalaxb.DataRecord[Any]] = Nil,
+  attributes: Map[String, scalaxb.DataRecord[Any]])
+
+
+case class Body(any: Seq[scalaxb.DataRecord[Any]] = Nil,
+  attributes: Map[String, scalaxb.DataRecord[Any]])
+
+
+/** 
+	    Fault reporting structure
+	  
+*/
+case class Fault(faultcode: javax.xml.namespace.QName,
+  faultstring: String,
+  faultactor: Option[java.net.URI] = None,
+  detail: Option[soapenvelope11.Detail] = None)
+
+
+case class Detail(any: Seq[scalaxb.DataRecord[Any]] = Nil,
+  attributes: Map[String, scalaxb.DataRecord[Any]])
+
+
+case class EncodingStyle(tnsencodingStyle: Option[Seq[java.net.URI]] = None)
+

src/main/scala/soapenvelope11_xmlprotocol.scala

+// Generated by <a href="http://scalaxb.org/">scalaxb</a>.
+package soapenvelope11
+
+/**
+usage:
+val obj = scalaxb.fromXML[soapenvelope11.Foo](node)
+val document = scalaxb.toXML[soapenvelope11.Foo](obj, "foo", soapenvelope11.defaultScope)
+**/
+object `package` extends XMLProtocol { }
+
+trait XMLProtocol extends scalaxb.XMLStandardTypes {
+  val defaultScope = scalaxb.toScope(Some("tns") -> "http://schemas.xmlsoap.org/soap/envelope/",
+    Some("xs") -> "http://www.w3.org/2001/XMLSchema",
+    Some("xsi") -> "http://www.w3.org/2001/XMLSchema-instance")
+  implicit lazy val Soapenvelope11EnvelopeFormat: scalaxb.XMLFormat[soapenvelope11.Envelope] = new DefaultSoapenvelope11EnvelopeFormat {}
+  implicit lazy val Soapenvelope11HeaderFormat: scalaxb.XMLFormat[soapenvelope11.Header] = new DefaultSoapenvelope11HeaderFormat {}
+  implicit lazy val Soapenvelope11BodyFormat: scalaxb.XMLFormat[soapenvelope11.Body] = new DefaultSoapenvelope11BodyFormat {}
+  implicit lazy val Soapenvelope11FaultFormat: scalaxb.XMLFormat[soapenvelope11.Fault] = new DefaultSoapenvelope11FaultFormat {}
+  implicit lazy val Soapenvelope11DetailFormat: scalaxb.XMLFormat[soapenvelope11.Detail] = new DefaultSoapenvelope11DetailFormat {}
+  implicit lazy val Soapenvelope11EncodingStyleFormat: scalaxb.AttributeGroupFormat[soapenvelope11.EncodingStyle] = new DefaultSoapenvelope11EncodingStyleFormat {}
+
+  trait DefaultSoapenvelope11EnvelopeFormat extends scalaxb.ElemNameParser[soapenvelope11.Envelope] {
+    val targetNamespace: Option[String] = Some("http://schemas.xmlsoap.org/soap/envelope/")
+    
+    override def typeName: Option[String] = Some("Envelope")
+
+    def parser(node: scala.xml.Node, stack: List[scalaxb.ElemName]): Parser[soapenvelope11.Envelope] =
+      phrase(opt(scalaxb.ElemName(Some("http://schemas.xmlsoap.org/soap/envelope/"), "Header")) ~ 
+      (scalaxb.ElemName(Some("http://schemas.xmlsoap.org/soap/envelope/"), "Body")) ~ 
+      rep(any(_.namespace != Some("http://schemas.xmlsoap.org/soap/envelope/"))) ^^
+      { case p1 ~ p2 ~ p3 =>
+      soapenvelope11.Envelope(p1.headOption map { scalaxb.fromXML[soapenvelope11.Header](_, scalaxb.ElemName(node) :: stack) },
+        scalaxb.fromXML[soapenvelope11.Body](p2, scalaxb.ElemName(node) :: stack),
+        p3.toSeq map { scalaxb.fromXML[scalaxb.DataRecord[Any]](_, scalaxb.ElemName(node) :: stack) },
+        scala.collection.immutable.ListMap((node match {
+          case elem: scala.xml.Elem =>
+            elem.attributes.toList flatMap {
+              
+              case scala.xml.UnprefixedAttribute(key, value, _) =>
+                List(("@" + key, scalaxb.DataRecord(None, Some(key), value.text)))
+              case scala.xml.PrefixedAttribute(pre, key, value, _) =>
+                val ns = elem.scope.getURI(pre)
+                List(("@{" + ns + "}" + key, scalaxb.DataRecord(Option[String](ns), Some(key), value.text)))
+              case _ => Nil
+            }
+          case _ => Nil
+        }): _*)) })
+    
+    override def writesAttribute(__obj: soapenvelope11.Envelope, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
+      var attr: scala.xml.MetaData  = scala.xml.Null
+      __obj.attributes.toList map {
+        case (key, x) => attr = scala.xml.Attribute((x.namespace map { __scope.getPrefix(_) }).orNull, x.key.orNull, x.value.toString, attr) }
+      attr
+    }
+
+    def writesChildNodes(__obj: soapenvelope11.Envelope, __scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node] =
+      Seq.concat(__obj.Header map { scalaxb.toXML[soapenvelope11.Header](_, Some("http://schemas.xmlsoap.org/soap/envelope/"), Some("Header"), __scope, false) } getOrElse {Nil},
+        scalaxb.toXML[soapenvelope11.Body](__obj.Body, Some("http://schemas.xmlsoap.org/soap/envelope/"), Some("Body"), __scope, false),
+        __obj.any flatMap { x => scalaxb.toXML[scalaxb.DataRecord[Any]](x, x.namespace, x.key, __scope, true) })
+
+  }
+
+  trait DefaultSoapenvelope11HeaderFormat extends scalaxb.ElemNameParser[soapenvelope11.Header] {
+    val targetNamespace: Option[String] = Some("http://schemas.xmlsoap.org/soap/envelope/")
+    
+    override def typeName: Option[String] = Some("Header")
+
+    def parser(node: scala.xml.Node, stack: List[scalaxb.ElemName]): Parser[soapenvelope11.Header] =
+      phrase(rep(any(_.namespace != Some("http://schemas.xmlsoap.org/soap/envelope/"))) ^^
+      { case p1 =>
+      soapenvelope11.Header(p1.toSeq map { scalaxb.fromXML[scalaxb.DataRecord[Any]](_, scalaxb.ElemName(node) :: stack) },
+        scala.collection.immutable.ListMap((node match {
+          case elem: scala.xml.Elem =>
+            elem.attributes.toList flatMap {
+              
+              case scala.xml.UnprefixedAttribute(key, value, _) =>
+                List(("@" + key, scalaxb.DataRecord(None, Some(key), value.text)))
+              case scala.xml.PrefixedAttribute(pre, key, value, _) =>
+                val ns = elem.scope.getURI(pre)
+                List(("@{" + ns + "}" + key, scalaxb.DataRecord(Option[String](ns), Some(key), value.text)))
+              case _ => Nil
+            }
+          case _ => Nil
+        }): _*)) })
+    
+    override def writesAttribute(__obj: soapenvelope11.Header, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
+      var attr: scala.xml.MetaData  = scala.xml.Null
+      __obj.attributes.toList map {
+        case (key, x) => attr = scala.xml.Attribute((x.namespace map { __scope.getPrefix(_) }).orNull, x.key.orNull, x.value.toString, attr) }
+      attr
+    }
+
+    def writesChildNodes(__obj: soapenvelope11.Header, __scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node] =
+      (__obj.any flatMap { x => scalaxb.toXML[scalaxb.DataRecord[Any]](x, x.namespace, x.key, __scope, true) })
+
+  }
+
+  trait DefaultSoapenvelope11BodyFormat extends scalaxb.ElemNameParser[soapenvelope11.Body] {
+    val targetNamespace: Option[String] = Some("http://schemas.xmlsoap.org/soap/envelope/")
+    
+    override def typeName: Option[String] = Some("Body")
+
+    def parser(node: scala.xml.Node, stack: List[scalaxb.ElemName]): Parser[soapenvelope11.Body] =
+      phrase(rep(any(_ => true)) ^^
+      { case p1 =>
+      soapenvelope11.Body(p1.toSeq map { scalaxb.fromXML[scalaxb.DataRecord[Any]](_, scalaxb.ElemName(node) :: stack) },
+        scala.collection.immutable.ListMap((node match {
+          case elem: scala.xml.Elem =>
+            elem.attributes.toList flatMap {
+              
+              case scala.xml.UnprefixedAttribute(key, value, _) =>
+                List(("@" + key, scalaxb.DataRecord(None, Some(key), value.text)))
+              case scala.xml.PrefixedAttribute(pre, key, value, _) =>
+                val ns = elem.scope.getURI(pre)
+                List(("@{" + ns + "}" + key, scalaxb.DataRecord(Option[String](ns), Some(key), value.text)))
+              case _ => Nil
+            }
+          case _ => Nil
+        }): _*)) })
+    
+    override def writesAttribute(__obj: soapenvelope11.Body, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
+      var attr: scala.xml.MetaData  = scala.xml.Null
+      __obj.attributes.toList map {
+        case (key, x) => attr = scala.xml.Attribute((x.namespace map { __scope.getPrefix(_) }).orNull, x.key.orNull, x.value.toString, attr) }
+      attr
+    }
+
+    def writesChildNodes(__obj: soapenvelope11.Body, __scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node] =
+      (__obj.any flatMap { x => scalaxb.toXML[scalaxb.DataRecord[Any]](x, x.namespace, x.key, __scope, true) })
+
+  }
+
+  trait DefaultSoapenvelope11FaultFormat extends scalaxb.ElemNameParser[soapenvelope11.Fault] {
+    val targetNamespace: Option[String] = Some("http://schemas.xmlsoap.org/soap/envelope/")
+    
+    override def typeName: Option[String] = Some("Fault")
+
+    def parser(node: scala.xml.Node, stack: List[scalaxb.ElemName]): Parser[soapenvelope11.Fault] =
+      phrase((scalaxb.ElemName(None, "faultcode")) ~ 
+      (scalaxb.ElemName(None, "faultstring")) ~ 
+      opt(scalaxb.ElemName(None, "faultactor")) ~ 
+      opt(scalaxb.ElemName(None, "detail")) ^^
+      { case p1 ~ p2 ~ p3 ~ p4 =>
+      soapenvelope11.Fault(scalaxb.fromXML[javax.xml.namespace.QName](p1, scalaxb.ElemName(node) :: stack),
+        scalaxb.fromXML[String](p2, scalaxb.ElemName(node) :: stack),
+        p3.headOption map { scalaxb.fromXML[java.net.URI](_, scalaxb.ElemName(node) :: stack) },
+        p4.headOption map { scalaxb.fromXML[soapenvelope11.Detail](_, scalaxb.ElemName(node) :: stack) }) })
+    
+    def writesChildNodes(__obj: soapenvelope11.Fault, __scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node] =
+      Seq.concat(scalaxb.toXML[javax.xml.namespace.QName](__obj.faultcode, None, Some("faultcode"), __scope, false),
+        scalaxb.toXML[String](__obj.faultstring, None, Some("faultstring"), __scope, false),
+        __obj.faultactor map { scalaxb.toXML[java.net.URI](_, None, Some("faultactor"), __scope, false) } getOrElse {Nil},
+        __obj.detail map { scalaxb.toXML[soapenvelope11.Detail](_, None, Some("detail"), __scope, false) } getOrElse {Nil})
+
+  }
+
+  trait DefaultSoapenvelope11DetailFormat extends scalaxb.ElemNameParser[soapenvelope11.Detail] {
+    val targetNamespace: Option[String] = Some("http://schemas.xmlsoap.org/soap/envelope/")
+    
+    override def typeName: Option[String] = Some("detail")
+
+    def parser(node: scala.xml.Node, stack: List[scalaxb.ElemName]): Parser[soapenvelope11.Detail] =
+      phrase(rep(any(_ => true)) ^^
+      { case p1 =>
+      soapenvelope11.Detail(p1.toSeq map { scalaxb.fromXML[scalaxb.DataRecord[Any]](_, scalaxb.ElemName(node) :: stack) },
+        scala.collection.immutable.ListMap((node match {
+          case elem: scala.xml.Elem =>
+            elem.attributes.toList flatMap {
+              
+              case scala.xml.UnprefixedAttribute(key, value, _) =>
+                List(("@" + key, scalaxb.DataRecord(None, Some(key), value.text)))
+              case scala.xml.PrefixedAttribute(pre, key, value, _) =>
+                val ns = elem.scope.getURI(pre)
+                List(("@{" + ns + "}" + key, scalaxb.DataRecord(Option[String](ns), Some(key), value.text)))
+              case _ => Nil
+            }
+          case _ => Nil
+        }): _*)) })
+    
+    override def writesAttribute(__obj: soapenvelope11.Detail, __scope: scala.xml.NamespaceBinding): scala.xml.MetaData = {
+      var attr: scala.xml.MetaData  = scala.xml.Null
+      __obj.attributes.toList map {
+        case (key, x) => attr = scala.xml.Attribute((x.namespace map { __scope.getPrefix(_) }).orNull, x.key.orNull, x.value.toString, attr) }
+      attr
+    }
+
+    def writesChildNodes(__obj: soapenvelope11.Detail, __scope: scala.xml.NamespaceBinding): Seq[scala.xml.Node] =
+      (__obj.any flatMap { x => scalaxb.toXML[scalaxb.DataRecord[Any]](x, x.namespace, x.key, __scope, true) })
+
+  }