diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index db1f019a81850fa2eef2ef613db14b5b28d02a30..7ad5f9608f1b8adda8c836b8db1d3a3435182b34 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -760,6 +760,29 @@ U8 LLFontGL::getStyleFromString(const std::string &style)
 	return ret;
 }
 
+// static
+std::string LLFontGL::getStringFromStyle(U8 style)
+{
+	std::string style_string;
+	if (style & NORMAL)
+	{
+		style_string += "|NORMAL";
+	}
+	if (style & BOLD)
+	{
+		style_string += "|BOLD";
+	}
+	if (style & ITALIC)
+	{
+		style_string += "|ITALIC";
+	}
+	if (style & UNDERLINE)
+	{
+		style_string += "|UNDERLINE";
+	}
+	return style_string;
+}
+
 // static
 std::string LLFontGL::nameFromFont(const LLFontGL* fontp)
 {
diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h
index bb7d8524e7fd053c3af0c06268c600f9d802a1f2..ea8eee769030267229d23506cbc5c8736c1a420b 100644
--- a/indra/llrender/llfontgl.h
+++ b/indra/llrender/llfontgl.h
@@ -144,6 +144,7 @@ class LLFontGL
 
 	// Takes a string with potentially several flags, i.e. "NORMAL|BOLD|ITALIC"
 	static U8 getStyleFromString(const std::string &style);
+	static std::string getStringFromStyle(U8 style);
 
 	static std::string nameFromFont(const LLFontGL* fontp);
 	static std::string sizeFromFont(const LLFontGL* fontp);
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index abd5436018dbd51a6045b29f710cdec3d18740c5..c1af42867468dc9b36ab2ba8616b524f21f231af 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -45,9 +45,8 @@ class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack>
 	{
 		Optional<std::string>	orientation;
 		Optional<S32>			border_size;
-		Optional<bool>			animate;
-		Optional<bool>			clip;
-		// mMinWidth and mMinHeight are calculated, not set in XML
+		Optional<bool>			animate,
+								clip;
 
 		Params();
 	};
diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h
index 2edfd7c2caeb32348eddebe600bc23d83a304618..b178bb36cafc66f53fbea0c51d5353bcd71a1dce 100644
--- a/indra/llui/llradiogroup.h
+++ b/indra/llui/llradiogroup.h
@@ -56,7 +56,7 @@ class LLRadioGroup
 	struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
 	{
 		Optional<bool>						has_border;
-		Multiple<ItemParams, LLInitParam::AtLeast<1> >	items;
+		Multiple<ItemParams, AtLeast<1> >	items;
 		Params();
 	};
 
diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h
index bd2d595174811d87aaa0d6235240a91b6c7775e9..714aca9337e1ddb1fa925d755ac23366c74d31a4 100644
--- a/indra/llui/llsearcheditor.h
+++ b/indra/llui/llsearcheditor.h
@@ -50,15 +50,17 @@ class LLSearchEditor : public LLUICtrl
 public:
 	struct Params : public LLInitParam::Block<Params, LLLineEditor::Params>
 	{
-		Optional<LLButton::Params> search_button, clear_button;
-		Optional<bool> search_button_visible, clear_button_visible;
+		Optional<LLButton::Params>	search_button, 
+									clear_button;
+		Optional<bool>				search_button_visible, 
+									clear_button_visible;
 		Optional<commit_callback_t> keystroke_callback;
 
 		Params()
-		: search_button("search_button")
-		, search_button_visible("search_button_visible")
-		, clear_button("clear_button")
-		, clear_button_visible("clear_button_visible")
+		:	search_button("search_button"),
+			search_button_visible("search_button_visible"),
+			clear_button("clear_button"), 
+			clear_button_visible("clear_button_visible")
 		{
 			name = "search_editor";
 		}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 660388790570994a1250d962015aa98f1382d4a8..67d3ed408b91ba3ad503decab5f4f714cc631df5 100644
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -1896,17 +1896,26 @@ namespace LLInitParam
 		control("")
 	{}
 
-	LLUIColor TypedParam<LLUIColor>::getValueFromBlock() const
+	void TypedParam<LLUIColor>::setValueFromBlock() const
 	{
 		if (control.isProvided())
 		{
-			return LLUIColorTable::instance().getColor(control);
+			mData.mValue = LLUIColorTable::instance().getColor(control);
 		}
 		else
 		{
-			return LLColor4(red, green, blue, alpha);
+			mData.mValue = LLColor4(red, green, blue, alpha);
 		}
 	}
+	
+	void TypedParam<LLUIColor>::setBlockFromValue()
+	{
+		LLColor4 color = mData.mValue.get();
+		red = color.mV[VRED];
+		green = color.mV[VGREEN];
+		blue = color.mV[VBLUE];
+		alpha = color.mV[VALPHA];
+	}
 
 	void TypeValues<LLUIColor>::declareValues()
 	{
@@ -1932,28 +1941,32 @@ namespace LLInitParam
 		addSynonym(name, "");
 	}
 
-	const LLFontGL* TypedParam<const LLFontGL*>::getValueFromBlock() const
+	void TypedParam<const LLFontGL*>::setValueFromBlock() const
 	{
-		if (name.isProvided())
+		const LLFontGL* res_fontp = LLFontGL::getFontByName(name);
+		if (res_fontp)
 		{
-			const LLFontGL* res_fontp = LLFontGL::getFontByName(name);
-			if (res_fontp)
-			{
-				return res_fontp;
-			}
+			mData.mValue = res_fontp;
+		}
 
-			U8 fontstyle = 0;
-			fontstyle = LLFontGL::getStyleFromString(style());
-			LLFontDescriptor desc(name(), size(), fontstyle);
-			const LLFontGL* fontp = LLFontGL::getFont(desc);
-			if (fontp)
-			{
-				return fontp;
-			}
+		U8 fontstyle = 0;
+		fontstyle = LLFontGL::getStyleFromString(style());
+		LLFontDescriptor desc(name(), size(), fontstyle);
+		const LLFontGL* fontp = LLFontGL::getFont(desc);
+		if (fontp)
+		{
+			mData.mValue = fontp;
+		}		
+	}
+	
+	void TypedParam<const LLFontGL*>::setBlockFromValue()
+	{
+		if (mData.mValue)
+		{
+			name = LLFontGL::nameFromFont(mData.mValue);
+			size = LLFontGL::sizeFromFont(mData.mValue);
+			style = LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle());
 		}
-		
-		// default to current value
-		return mData.mValue;
 	}
 
 	TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count)
@@ -1966,7 +1979,7 @@ namespace LLInitParam
 		height("height")
 	{}
 
-	LLRect TypedParam<LLRect>::getValueFromBlock() const
+	void TypedParam<LLRect>::setValueFromBlock() const
 	{
 		LLRect rect;
 
@@ -2027,7 +2040,17 @@ namespace LLInitParam
 			rect.mBottom = bottom;
 			rect.mTop = top;
 		}
-		return rect;
+		mData.mValue = rect;
+	}
+	
+	void TypedParam<LLRect>::setBlockFromValue()
+	{
+		left = mData.mValue.mLeft;
+		right = mData.mValue.mRight;
+		bottom = mData.mValue.mBottom;
+		top = mData.mValue.mTop;
+		width.setProvided(false);
+		height.setProvided(false);
 	}
 
 	TypedParam<LLCoordGL>::TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count)
@@ -2037,9 +2060,15 @@ namespace LLInitParam
 	{
 	}
 
-	LLCoordGL TypedParam<LLCoordGL>::getValueFromBlock() const
+	void TypedParam<LLCoordGL>::setValueFromBlock() const
+	{
+		mData.mValue.set(x, y);
+	}
+	
+	void TypedParam<LLCoordGL>::setBlockFromValue()
 	{
-		return LLCoordGL(x, y);
+		x = mData.mValue.mX;
+		y = mData.mValue.mY;
 	}
 
 
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 5ec07f1941b726439649298358a1152a7f8a3d3f..5840e76f5c7c2eeb9ee199d2493e3aee80ff21df 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -379,7 +379,8 @@ namespace LLInitParam
 
 		TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
 
-		LLRect getValueFromBlock() const;
+		void setValueFromBlock() const;
+		void setBlockFromValue();
 	};
 
 	template<>
@@ -401,7 +402,8 @@ namespace LLInitParam
 		Optional<std::string> control;
 
 		TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
-		LLUIColor getValueFromBlock() const;
+		void setValueFromBlock() const;
+		void setBlockFromValue();
 	};
 
 	// provide a better default for Optional<const LLFontGL*> than NULL
@@ -429,7 +431,8 @@ namespace LLInitParam
 								style;
 
 		TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
-		const LLFontGL* getValueFromBlock() const;
+		void setValueFromBlock() const;
+		void setBlockFromValue();
 	};
 
 	template<>
@@ -467,7 +470,8 @@ namespace LLInitParam
 						y;
 
 		TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count);
-		LLCoordGL getValueFromBlock() const;
+		void setValueFromBlock() const;
+		void setBlockFromValue();
 	};
 }
 
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 6a7879c8c2ef18d07e17af653b21d252f4c034d9..625d3c63e56d54b44d5971ab12b230394d07c2aa 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -105,9 +105,12 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa
 	}
 }
 
+static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children");
+
 //static 
 void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node)
 {
+	LLFastTimer ft(FTM_CREATE_CHILDREN);
 	if (node.isNull()) return;
 
 	for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling())
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index e4bac48fd3dd9b2d8a0d7a39bd3a5b8c73a230cb..6dab9521bb61a0f1c287088804d78efc660ae75a 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -182,9 +182,6 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 	template<typename T>
 	static T* createWidget(typename T::Params& params, LLView* parent = NULL)
 	{
-		// Apply layout transformations, usually munging rect
-		T::setupParams(params, parent);
-
 		T* widget = NULL;
 
 		if (!params.validateBlock())
@@ -309,7 +306,8 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 				output_node, output_params, &default_params);
 		}
 
-		params.from_xui = true;
+		// Apply layout transformations, usually munging rect
+		T::setupParams(params, parent);
 
 		T* widget = createWidget<T>(params, parent);
 
diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp
index f941f391eb3c1b4e825ab8801c04bdbe34413c49..1dfc281d93e66190c20c43e54dbc27e0039ba2ad 100644
--- a/indra/llui/lluiimage.cpp
+++ b/indra/llui/lluiimage.cpp
@@ -161,22 +161,32 @@ void LLUIImage::onImageLoaded()
 
 namespace LLInitParam
 {
-	LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const
+	void TypedParam<LLUIImage*>::setValueFromBlock() const
 	{
 		// The keyword "none" is specifically requesting a null image
 		// do not default to current value. Used to overwrite template images. 
 		if (name() == "none")
 		{
-			return NULL;
+			mData.mValue = NULL;
 		}
 
 		LLUIImage* imagep =  LLUI::getUIImage(name());
-		if (!imagep)
+		if (imagep)
 		{
-			// default to current value
-			imagep = mData.mValue;
+			mData.mValue = imagep;
+		}
+	}
+	
+	void TypedParam<LLUIImage*>::setBlockFromValue()
+	{
+		if (mData.mValue == NULL)
+		{
+			name = "none";
+		}
+		else
+		{
+			name = mData.mValue->getName();
 		}
-		return imagep;
 	}
 
 	
diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h
index 5fa9610ab20df4c1995592835883685224e7c1c5..bdfc44262d6000de64d668cbd52498c08a68447e 100644
--- a/indra/llui/lluiimage.h
+++ b/indra/llui/lluiimage.h
@@ -111,7 +111,8 @@ namespace LLInitParam
 		{
 		}
 
-		LLUIImage* getValueFromBlock() const;
+		void setValueFromBlock() const;
+		void setBlockFromValue();
 	};
 
 	// Need custom comparison function for our test app, which only loads
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 7932b749a8348a5ca954a33779a1bad3b8de2b3a..9f6fc1f298bee46bb0c3a3d2637f7685320e51d5 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -2501,6 +2501,8 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
 		p.layout = parent->getLayout();
 	}
 
+	p.from_xui = true;
+
 	if (parent)
 	{
 		LLRect parent_rect = parent->getLocalRect();
@@ -2516,7 +2518,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent)
 		}
 
 		// convert negative or centered coordinates to parent relative values
-		// Note: some of this logic matches the logic in TypedParam<LLRect>::getValueFromBlock()
+		// Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
 
 		if (p.center_horiz)
 		{
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 493ddaa3785d118543035b876dd2f0d77d017415..7e1e4a3d2183d4425e538f423cae6e1470df12f6 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -1,5 +1,5 @@
 /** 
- * @file llinitparam.h
+f * @file llinitparam.h
  * @brief parameter block abstraction for creating complex objects and 
  * parsing construction parameters from xml and LLSD
  *
@@ -405,6 +405,41 @@ namespace LLInitParam
 	class BaseBlock
 	{
 	public:
+		// "Multiple" constraint types
+		struct AnyAmount
+		{
+			static U32 minCount() { return 0; }
+			static U32 maxCount() { return U32_MAX; }
+		};
+
+		template<U32 MIN_AMOUNT>
+		struct AtLeast
+		{
+			static U32 minCount() { return MIN_AMOUNT; }
+			static U32 maxCount() { return U32_MAX; }
+		};
+
+		template<U32 MAX_AMOUNT>
+		struct AtMost
+		{
+			static U32 minCount() { return 0; }
+			static U32 maxCount() { return MAX_AMOUNT; }
+		};
+
+		template<U32 MIN_AMOUNT, U32 MAX_AMOUNT>
+		struct Between
+		{
+			static U32 minCount() { return MIN_AMOUNT; }
+			static U32 maxCount() { return MAX_AMOUNT; }
+		};
+
+		template<U32 EXACT_COUNT>
+		struct Exactly
+		{
+			static U32 minCount() { return EXACT_COUNT; }
+			static U32 maxCount() { return EXACT_COUNT; }
+		};
+
 		// this typedef identifies derived classes as being blocks
 		typedef void baseblock_base_class_t;
 		LOG_CLASS(BaseBlock);
@@ -1365,40 +1400,6 @@ namespace LLInitParam
 		}
 	};
 
-	struct AnyAmount
-	{
-		static U32 minCount() { return 0; }
-		static U32 maxCount() { return U32_MAX; }
-	};
-
-	template<U32 MIN_AMOUNT>
-	struct AtLeast
-	{
-		static U32 minCount() { return MIN_AMOUNT; }
-		static U32 maxCount() { return U32_MAX; }
-	};
-
-	template<U32 MAX_AMOUNT>
-	struct AtMost
-	{
-		static U32 minCount() { return 0; }
-		static U32 maxCount() { return MAX_AMOUNT; }
-	};
-
-	template<U32 MIN_AMOUNT, U32 MAX_AMOUNT>
-	struct Between
-	{
-		static U32 minCount() { return MIN_AMOUNT; }
-		static U32 maxCount() { return MAX_AMOUNT; }
-	};
-
-	template<U32 EXACT_COUNT>
-	struct Exactly
-	{
-		static U32 minCount() { return EXACT_COUNT; }
-		static U32 maxCount() { return EXACT_COUNT; }
-	};
-
 	template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlock>
 	class Block 
 	:	public BASE_BLOCK
@@ -1491,7 +1492,7 @@ namespace LLInitParam
 
 		};
 
-		template <typename T, typename RANGE = AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> >
+		template <typename T, typename RANGE = BaseBlock::AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> >
 		class Multiple : public TypedParam<T, NAME_VALUE_LOOKUP, true>
 		{
 		public:
@@ -1711,7 +1712,7 @@ namespace LLInitParam
 			{
 				if (block_t::validateBlock(true))
 				{
-					mData.mValue = static_cast<const DERIVED*>(this)->getValueFromBlock();
+					static_cast<const DERIVED*>(this)->setValueFromBlock();
 					// clear stale keyword associated with old value
 					mData.clearKey();
 					mData.mLastParamVersion = BaseBlock::getLastChangeVersion();
@@ -1737,6 +1738,7 @@ namespace LLInitParam
 			mData.mValue = val;
 			mData.clearKey();
 			setProvided(flag_as_provided);
+			static_cast<DERIVED*>(this)->setBlockFromValue();
 		}
 
 		void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true)
@@ -1768,7 +1770,7 @@ namespace LLInitParam
 				// go ahead and issue warnings at this point if any param is invalid
 				if(block_t::validateBlock(false))
 				{
-					mData.mValue = static_cast<const DERIVED*>(this)->getValueFromBlock();
+					static_cast<const DERIVED*>(this)->setValueFromBlock();
 					mData.clearKey();
 					mData.mLastParamVersion = BaseBlock::getLastChangeVersion();
 				}